Browse Source

bugfix: null combat target

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
5159afc704
  1. 10
      src/engine/gameManager/CombatManager.java

10
src/engine/gameManager/CombatManager.java

@ -829,8 +829,14 @@ public enum CombatManager { @@ -829,8 +829,14 @@ public enum CombatManager {
damage *= 2.5f; //increase damage if sitting
if (tarAc.getObjectType() == GameObjectType.Mob) {
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter))
((Mob)tarAc).playerAgroMap.put(ac.getObjectUUID(), ((Mob) tarAc).playerAgroMap.get(ac.getObjectUUID()) + damage);
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)) {
if(((Mob) tarAc).playerAgroMap.contains(ac.getObjectUUID())) {
((Mob) tarAc).playerAgroMap.put(ac.getObjectUUID(), ((Mob) tarAc).playerAgroMap.get(ac.getObjectUUID()) + damage);
} else{
((Mob) tarAc).playerAgroMap.put(ac.getObjectUUID(), damage);
}
}
((Mob) tarAc).handleDirectAggro(ac);
}

Loading…
Cancel
Save