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(String name);
|
||||||
|
|
||||||
public boolean removeWarp(LazyLocation loc);
|
|
||||||
|
|
||||||
public void clearWarps();
|
public void clearWarps();
|
||||||
|
|
||||||
public void addAnnouncement(FPlayer fPlayer, String msg);
|
public void addAnnouncement(FPlayer fPlayer, String msg);
|
||||||
|
@ -47,9 +47,10 @@ public abstract class MemoryBoard extends Board {
|
|||||||
|
|
||||||
public void removeAt(FLocation flocation) {
|
public void removeAt(FLocation flocation) {
|
||||||
Faction faction = getFactionAt(flocation);
|
Faction faction = getFactionAt(flocation);
|
||||||
for (LazyLocation loc : faction.getWarps().values()) {
|
Iterator<LazyLocation> it = faction.getWarps().values().iterator();
|
||||||
if (flocation.isInChunk(loc.getLocation())) {
|
while (it.hasNext()) {
|
||||||
faction.removeWarp(loc);
|
if (flocation.isInChunk(it.next().getLocation())) {
|
||||||
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clearOwnershipAt(flocation);
|
clearOwnershipAt(flocation);
|
||||||
|
@ -86,19 +86,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean removeWarp(String name) {
|
public boolean removeWarp(String name) {
|
||||||
if (warps.containsKey(name)) {
|
return warps.remove(name) != null;
|
||||||
warps.remove(name);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean removeWarp(LazyLocation loc) {
|
|
||||||
if (warps.containsValue(loc)) {
|
|
||||||
warps.remove(loc);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearWarps() {
|
public void clearWarps() {
|
||||||
|
Loading…
Reference in New Issue
Block a user