From 501e8c937f9b41d7afd07760273f7b169ce68cfd Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 9 Sep 2023 22:10:10 -0500 Subject: [PATCH] guards use city player memory to determine whether they go idle or not --- src/engine/mobileAI/MobAI.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 0126c4ad..9afc373a 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -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);