Correctly remove faction warps in unclaimed land
This commit is contained in:
parent
5799a0480b
commit
d36e88f2c0
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user