From e7c3ba5ebaad92561c4e6838da6b3a90c85e8e25 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 9 Sep 2023 22:30:45 -0500 Subject: [PATCH] guards and siege engines ignore idle state with no players loaded --- src/engine/mobileAI/MobAI.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 4e263408..8b710e4b 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -582,8 +582,9 @@ public class MobAI { boolean bypassLoadedPlayerCheck = false; 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.combatTarget != null && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) + if(mob.combatTarget.loc.distanceSquared(mob.loc) > 10000) + mob.setCombatTarget(null); } if (mob.playerAgroMap.isEmpty() && !bypassLoadedPlayerCheck) {