diff --git a/src/engine/objects/Bane.java b/src/engine/objects/Bane.java index 7af0c443..f0363744 100644 --- a/src/engine/objects/Bane.java +++ b/src/engine/objects/Bane.java @@ -762,13 +762,15 @@ public final class Bane { float attackerMultiplier = ZergManager.getCurrentMultiplier(attackerSize,this.capSize); float defenderMultiplier = ZergManager.getCurrentMultiplier(defenderSize,this.capSize); for(int uuid : attackers){ - if(city._playerMemory.contains(uuid)) //player is still physically here, needs updated multiplier - PlayerCharacter.getPlayerCharacter(uuid).ZergMultiplier = attackerMultiplier; + PlayerCharacter player = PlayerCharacter.getPlayerCharacter(uuid); + if(inSiegeRange.contains(player)) //player is still physically here, needs updated multiplier + player.ZergMultiplier = attackerMultiplier; } for(int uuid : defenders){ - if(city._playerMemory.contains(uuid)) //player is still physically here, needs updated multiplier - PlayerCharacter.getPlayerCharacter(uuid).ZergMultiplier = defenderMultiplier; + PlayerCharacter player = PlayerCharacter.getPlayerCharacter(uuid); + if(inSiegeRange.contains(player)) //player is still physically here, needs updated multiplier + player.ZergMultiplier = defenderMultiplier; } } diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index 88953db5..da4771d6 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -1063,15 +1063,19 @@ public class City extends AbstractWorldObject { private void onExitBane() { Iterator iterator = this.baneAttendees.keySet().iterator(); + ArrayList toRemove = new ArrayList<>(); while (iterator.hasNext()) { Integer uuid = iterator.next(); if (!_playerMemory.contains(uuid)) { long timeGone = System.currentTimeMillis() - this.baneAttendees.get(uuid).longValue(); - if (timeGone > 180000) { // 3 minutes - iterator.remove(); + if (timeGone > 180000L) { // 3 minutes + toRemove.add(uuid); } } } + for(int uuid : toRemove){ + this.baneAttendees.remove(uuid); + } }