From 4fd9a358a6f2a85493f637fd036340c440196f87 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 18 Jul 2023 20:09:37 -0500 Subject: [PATCH] pets will stop chasing mobs that are no longer a threat to player --- src/engine/ai/MobileFSM.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index ae509afa..acc7d9bb 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -675,8 +675,9 @@ public class MobileFSM { mob.killCharacter("no owner"); } } - if (mob.getCombatTarget() != null && !mob.getCombatTarget().isAlive()) - mob.setCombatTarget(null); + if (mob.getCombatTarget() != null) + if(!mob.getCombatTarget().isAlive() || mob.getCombatTarget().getLoc().distanceSquared(mob.getOwner().getLoc()) > 75) + mob.setCombatTarget(null); if (MovementUtilities.canMove(mob) && mob.BehaviourType.canRoam) CheckMobMovement(mob); CheckForAttack(mob);