Browse Source

guards will revert cmbat target to null if its a player and is no longer loaded

feature-workorder
FatBoy-DOTC 1 year ago
parent
commit
ea86ab2300
  1. 11
      src/engine/mobileAI/MobAI.java

11
src/engine/mobileAI/MobAI.java

@ -580,13 +580,10 @@ public class MobAI {
//no players loaded, no need to proceed unless it's a player guard //no players loaded, no need to proceed unless it's a player guard
boolean bypassLoadedPlayerCheck = false; boolean bypassLoadedPlayerCheck = false;
if(mob.isPlayerGuard()) { if(mob.isPlayerGuard() || mob.isSiege()) {
bypassLoadedPlayerCheck = true;
if (mob.guardedCity != null) { if(mob.combatTarget != null && !mob.playerAgroMap.containsKey(mob.combatTarget.getObjectUUID()) && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
if (!mob.guardedCity._playerMemory.isEmpty()) { mob.setCombatTarget(null);
bypassLoadedPlayerCheck = true;
}
}
} }
if (mob.playerAgroMap.isEmpty() && !bypassLoadedPlayerCheck) { if (mob.playerAgroMap.isEmpty() && !bypassLoadedPlayerCheck) {

Loading…
Cancel
Save