Browse Source

combat bug fix

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
e3ec8d7737
  1. 23
      src/engine/objects/Mine.java

23
src/engine/objects/Mine.java

@ -56,7 +56,6 @@ public class Mine extends AbstractGameObject { @@ -56,7 +56,6 @@ public class Mine extends AbstractGameObject {
public final HashSet<Integer> _playerMemory = new HashSet<>();
public final HashMap<Integer,Long> _recentMemory = new HashMap<>();
HashMap<Guild,ArrayList<Integer>> dividedPlayers;
public Integer totalPlayers;
public boolean hasProduced = false;
@ -674,8 +673,7 @@ public class Mine extends AbstractGameObject { @@ -674,8 +673,7 @@ public class Mine extends AbstractGameObject {
// Gather current list of players within the zone bounds
Building tower = BuildingManager.getBuildingFromCache(this.buildingID);
currentPlayers = WorldGrid.getObjectsInRangePartial(tower.loc, Enum.CityBoundsType.GRID.extents, MBServerStatics.MASK_PLAYER);
boolean updated = false;
currentPlayers = WorldGrid.getObjectsInRangePartial(tower.loc, Enum.CityBoundsType.GRID.extents * 0.5f, MBServerStatics.MASK_PLAYER);
for (AbstractWorldObject playerObject : currentPlayers) {
@ -685,23 +683,20 @@ public class Mine extends AbstractGameObject { @@ -685,23 +683,20 @@ public class Mine extends AbstractGameObject {
player = (PlayerCharacter) playerObject;
// Player is already in our memory
if (_recentMemory.containsKey(player.getObjectUUID()))
_recentMemory.remove(player.getObjectUUID());
if (this._recentMemory.containsKey(player.getObjectUUID()))
this._recentMemory.remove(player.getObjectUUID());
if (_playerMemory.contains(player.getObjectUUID()))
if (this._playerMemory.contains(player.getObjectUUID()))
continue;
// Add player to our city's memory
_playerMemory.add(player.getObjectUUID());
updated = true;
this._playerMemory.add(player.getObjectUUID());
// ***For debugging
// Logger.info("PlayerMemory for ", this.getCityName() + ": " + _playerMemory.size());
}
this.totalPlayers = this._playerMemory.size();
try {
updated = onExitZerg(currentPlayers);
onExitZerg(currentPlayers);
} catch (Exception e) {
Logger.error(e.getMessage());
}
@ -760,8 +755,8 @@ public class Mine extends AbstractGameObject { @@ -760,8 +755,8 @@ public class Mine extends AbstractGameObject {
continue;
toRemove.add(playerUUID);
if(_recentMemory.containsKey(playerUUID) == false) {
_recentMemory.put(playerUUID, System.currentTimeMillis());
if(this._recentMemory.containsKey(playerUUID) == false) {
this._recentMemory.put(playerUUID, System.currentTimeMillis());
PlayerCharacter.getPlayerCharacter(playerUUID).mineAppliedID = 0;
PlayerCharacter.getPlayerCharacter(playerUUID).ZergMultiplier = 1.0f;
}
@ -778,7 +773,7 @@ public class Mine extends AbstractGameObject { @@ -778,7 +773,7 @@ public class Mine extends AbstractGameObject {
}
}
for(Integer id : purge){
_recentMemory.remove(id);
this._recentMemory.remove(id);
}
if(toRemove.isEmpty()){
return false;

Loading…
Cancel
Save