From 9de87fc2a2649c1d26350afa9c2d724d21c76730 Mon Sep 17 00:00:00 2001 From: eueln Date: Fri, 28 Aug 2015 13:41:08 -0400 Subject: [PATCH] Fix CME when cleaning Factions from the board. Fixes #515 --- .../factions/zcore/persist/MemoryBoard.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java index a5cb17c5..c1df8f5f 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java @@ -49,8 +49,11 @@ public abstract class MemoryBoard extends Board { return factionToLandMap.get(factionId).size(); } - public Collection getOwnedLand(String factionId) { - return factionToLandMap.get(factionId); + public void removeFaction(String factionId) { + Collection flocations = factionToLandMap.removeAll(factionId); + for (FLocation floc : flocations) { + super.remove(floc); + } } } @@ -131,10 +134,7 @@ public abstract class MemoryBoard extends Board { } public void clean(String factionId) { - Collection keys = flocationIds.getOwnedLand(factionId); - for (FLocation key : keys) { - flocationIds.remove(key); - } + flocationIds.removeFaction(factionId); } // Is this coord NOT completely surrounded by coords claimed by the same faction?