Correctly remove faction warps in unclaimed land

This commit is contained in:
eueln 2015-01-06 11:57:33 -06:00
parent 5799a0480b
commit d36e88f2c0
3 changed files with 5 additions and 18 deletions

View File

@ -25,8 +25,6 @@ public interface Faction extends EconomyParticipator {
public boolean removeWarp(String name);
public boolean removeWarp(LazyLocation loc);
public void clearWarps();
public void addAnnouncement(FPlayer fPlayer, String msg);

View File

@ -47,9 +47,10 @@ public abstract class MemoryBoard extends Board {
public void removeAt(FLocation flocation) {
Faction faction = getFactionAt(flocation);
for (LazyLocation loc : faction.getWarps().values()) {
if (flocation.isInChunk(loc.getLocation())) {
faction.removeWarp(loc);
Iterator<LazyLocation> it = faction.getWarps().values().iterator();
while (it.hasNext()) {
if (flocation.isInChunk(it.next().getLocation())) {
it.remove();
}
}
clearOwnershipAt(flocation);

View File

@ -86,19 +86,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
}
public boolean removeWarp(String name) {
if (warps.containsKey(name)) {
warps.remove(name);
return true;
}
return false;
}
public boolean removeWarp(LazyLocation loc) {
if (warps.containsValue(loc)) {
warps.remove(loc);
return true;
}
return false;
return warps.remove(name) != null;
}
public void clearWarps() {