From 48bcf1bd1fe8cf2236be599f31100140cd8c2c59 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 22 Jul 2023 18:47:29 -0500 Subject: [PATCH] removed distance check preventing pets from attacking --- src/engine/ai/MobileFSM.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index d06386e7..ac4699ff 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -604,10 +604,10 @@ public class MobileFSM { private static void chaseTarget(Mob mob) { mob.updateMovementState(); - //if (mob.playerAgroMap.containsKey(mob.getCombatTarget().getObjectUUID()) == false) { - // mob.setCombatTarget(null); - // return; - //} + if (mob.playerAgroMap.containsKey(mob.getCombatTarget().getObjectUUID()) == false) { + mob.setCombatTarget(null); + return; + } if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { if (mob.getRange() > 15) { mob.destination = mob.getCombatTarget().getLoc(); @@ -679,8 +679,8 @@ public class MobileFSM { } } if (mob.getCombatTarget() != null) - if(!mob.getCombatTarget().isAlive() || mob.getCombatTarget().getLoc().distanceSquared(mob.getOwner().getLoc()) > 75) - mob.setCombatTarget(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);