From c0676c3548f4082f2a3621bd5a376e447e743c29 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Mon, 1 Aug 2011 17:54:05 -0500 Subject: [PATCH] Fix for error that could occur when unclaiming land --- src/com/massivecraft/factions/Faction.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/massivecraft/factions/Faction.java b/src/com/massivecraft/factions/Faction.java index f0baf011..8a799f1f 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -273,6 +273,18 @@ public class Faction { return ret; } + public FPlayer getFPlayerAdmin() { + if (id <= 0) + return null; + + for (FPlayer fplayer : FPlayer.getAll()) { + if (fplayer.getFaction() == this && fplayer.getRole() == Role.ADMIN) { + return fplayer; + } + } + return null; + } + public ArrayList getFPlayersWhereRole(Role role) { ArrayList ret = new ArrayList(); if (id <= 0) @@ -411,10 +423,12 @@ public class Faction { } public void clearAllClaimOwnership() { + isClaimOwnershipEmpty(); claimOwnership.clear(); } public void clearClaimOwnership(FLocation loc) { + isClaimOwnershipEmpty(); claimOwnership.remove(loc); }