Browse Source

guards use city player memory to determine whether they go idle or not

feature-workorder
FatBoy-DOTC 1 year ago
parent
commit
501e8c937f
  1. 14
      src/engine/mobileAI/MobAI.java

14
src/engine/mobileAI/MobAI.java

@ -578,14 +578,24 @@ public class MobAI { @@ -578,14 +578,24 @@ public class MobAI {
return;
}
//no players loaded, no need to proceed
//no players loaded, no need to proceed unless it's a player guard
boolean bypassLoadedPlayerCheck = false;
if(mob.isPlayerGuard()) {
if (mob.playerAgroMap.isEmpty()) {
if (mob.guardedCity != null) {
if (!mob.guardedCity._playerMemory.isEmpty()) {
bypassLoadedPlayerCheck = true;
}
}
}
if (mob.playerAgroMap.isEmpty() && !bypassLoadedPlayerCheck) {
if (mob.getCombatTarget() != null)
mob.setCombatTarget(null);
return;
}
if (mob.agentType.equals(Enum.AIAgentType.PET) == false)
CheckToSendMobHome(mob);

Loading…
Cancel
Save