From abc57688d39c169027cce3425a1bcc654aa65bd3 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 15 Jun 2024 10:31:38 -0500 Subject: [PATCH] reset zerg multipliers when window closes --- src/engine/objects/Mine.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 4f938261..814710db 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -359,6 +359,16 @@ public class Mine extends AbstractGameObject { Building building = BuildingManager.getBuildingFromCache(this.buildingID); if (building != null && !this.isActive) building.isDeranking.compareAndSet(true, false); + + if(!isAc){ + for(PlayerCharacter player : this.affectedPlayers){ + try { + player.ZergMultiplier = 1.0f; + } catch(Exception e){ + //something went wrong resetting zerg multiplier, maybe player was deleted? + } + } + } } public boolean validForMine(Resource r) { @@ -563,6 +573,10 @@ public class Mine extends AbstractGameObject { continue; PlayerCharacter player = (PlayerCharacter) playerObject; + + if(this.affectedPlayers.contains(player) == false) + this.affectedPlayers.add(player); + if(!this._playerMemory.contains(player.getObjectUUID())){ this._playerMemory.add(player.getObjectUUID()); }