From ea86ab230058d68ba9da443ae35865c3d8d9f4af Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 9 Sep 2023 22:23:25 -0500 Subject: [PATCH] guards will revert cmbat target to null if its a player and is no longer loaded --- src/engine/mobileAI/MobAI.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 9afc373a..4e263408 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/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 boolean bypassLoadedPlayerCheck = false; - if(mob.isPlayerGuard()) { - - if (mob.guardedCity != null) { - if (!mob.guardedCity._playerMemory.isEmpty()) { - bypassLoadedPlayerCheck = true; - } - } + if(mob.isPlayerGuard() || mob.isSiege()) { + bypassLoadedPlayerCheck = true; + if(mob.combatTarget != null && !mob.playerAgroMap.containsKey(mob.combatTarget.getObjectUUID()) && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) + mob.setCombatTarget(null); } if (mob.playerAgroMap.isEmpty() && !bypassLoadedPlayerCheck) {