diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 1940c588..38c63b1c 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -695,8 +695,10 @@ public class Mine extends AbstractGameObject { // ***For debugging // Logger.info("PlayerMemory for ", this.getCityName() + ": " + _playerMemory.size()); } + boolean updated = false; try { - onExitZerg(currentPlayers); + //updated = onExitZerg(currentPlayers); + updated = onExit(currentPlayers); } catch (Exception e) { Logger.error(e.getMessage()); } @@ -737,7 +739,23 @@ public class Mine extends AbstractGameObject { } //} } - + private Boolean onExit(HashSet currentPlayers){ + ArrayList purge = new ArrayList<>(); + for(int id : this._playerMemory){ + PlayerCharacter player = PlayerCharacter.getPlayerCharacter(id); + if(currentPlayers.contains(player) == false){ + purge.add(id); + player.ZergMultiplier = 1.0f; + ChatManager.chatSystemInfo(player,"Left Mine, Multiplier: " + player.ZergMultiplier); + } + } + if(purge.size() > 0) { + this._playerMemory.removeAll(purge); + return true; + } else{ + return false; + } + } private Boolean onExitZerg(HashSet currentPlayers) { PlayerCharacter player; @@ -774,6 +792,9 @@ public class Mine extends AbstractGameObject { } for(Integer id : purge){ this._recentMemory.remove(id); + this._playerMemory.remove(id); + PlayerCharacter.getPlayerCharacter(playerUUID).mineAppliedID = 0; + PlayerCharacter.getPlayerCharacter(playerUUID).ZergMultiplier = 1.0f; } if(toRemove.isEmpty()){ return false;