diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index c2faa99a..a205b114 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -140,9 +140,14 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator public final void resetFactionData(boolean doSpotUpdate) { - Faction currentFaction = this.getFaction(); - if (currentFaction != null) - currentFaction.removeFPlayer(this); + 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. + { + Faction currentFaction = this.getFaction(); + if (currentFaction != null) + { + currentFaction.removeFPlayer(this); + } + } this.factionId = "0"; // The default neutral faction this.chatMode = ChatMode.PUBLIC; diff --git a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java index d083a8d4..41598686 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -288,7 +288,7 @@ public class FactionsPlayerListener implements Listener me.getPower(); // update power, so they won't have gained any while dead - Location home = me.getFaction().getHome(); + Location home = me.getFaction().getHome(); // TODO: WARNING FOR NPE HERE THE ORIO FOR RESPAWN SHOULD BE ASSIGNABLE FROM CONFIG. if ( Conf.homesEnabled