Panic fix to remove infinite loop

This commit is contained in:
Olof Larsson 2012-01-28 17:15:20 +01:00
parent 7575cfcafc
commit c248d419bb

View File

@ -133,9 +133,14 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
public final void resetFactionData(boolean doSpotUpdate) public final void resetFactionData(boolean doSpotUpdate)
{ {
Faction currentFaction = this.getFaction(); if (this.factionId != null && Factions.i.exists(this.factionId)) // Avoid infinite loop! TODO: I think that this is needed is a sign we need to refactor.
if (currentFaction != null) {
currentFaction.removeFPlayer(this); Faction currentFaction = this.getFaction();
if (currentFaction != null)
{
currentFaction.removeFPlayer(this);
}
}
this.factionId = "0"; // The default neutral faction this.factionId = "0"; // The default neutral faction
this.chatMode = ChatMode.PUBLIC; this.chatMode = ChatMode.PUBLIC;