Browse Source

reset zerg multipliers when window closes

lakebane-new
FatBoy-DOTC 5 months ago
parent
commit
abc57688d3
  1. 14
      src/engine/objects/Mine.java

14
src/engine/objects/Mine.java

@ -359,6 +359,16 @@ public class Mine extends AbstractGameObject {
Building building = BuildingManager.getBuildingFromCache(this.buildingID); Building building = BuildingManager.getBuildingFromCache(this.buildingID);
if (building != null && !this.isActive) if (building != null && !this.isActive)
building.isDeranking.compareAndSet(true, false); 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) { public boolean validForMine(Resource r) {
@ -563,6 +573,10 @@ public class Mine extends AbstractGameObject {
continue; continue;
PlayerCharacter player = (PlayerCharacter) playerObject; PlayerCharacter player = (PlayerCharacter) playerObject;
if(this.affectedPlayers.contains(player) == false)
this.affectedPlayers.add(player);
if(!this._playerMemory.contains(player.getObjectUUID())){ if(!this._playerMemory.contains(player.getObjectUUID())){
this._playerMemory.add(player.getObjectUUID()); this._playerMemory.add(player.getObjectUUID());
} }

Loading…
Cancel
Save