From 67808b69a6247a0e5a1dc1e028de845c204f5247 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 28 May 2023 12:07:00 -0500 Subject: [PATCH] check for dead target --- src/engine/ai/MobileFSM.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index dad70e98..a5cd74be 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -174,12 +174,6 @@ public class MobileFSM { rwss.setPlayer(mob); DispatchMessage.sendToAllInRange(mob, rwss); } - if (mob.isMoving() == true) { - //early exit for a mob who is already moving to a patrol point - //while mob moving, update lastPatrolTime so that when they stop moving the 10 second timer can begin - mob.stopPatrolTime = System.currentTimeMillis(); - return; - } int patrolDelay = ThreadLocalRandom.current().nextInt((int)(MBServerStatics.AI_PATROL_DIVISOR * 0.5f), MBServerStatics.AI_PATROL_DIVISOR) + MBServerStatics.AI_PATROL_DIVISOR; if (mob.stopPatrolTime + (patrolDelay * 1000) > System.currentTimeMillis()) //early exit while waiting to patrol again @@ -337,6 +331,9 @@ public class MobileFSM { } mob.updateLocation(); CheckToSendMobHome(mob); + if(mob.combatTarget != null && mob.combatTarget.isAlive() == false){ + mob.setCombatTarget(null); + } switch (mob.BehaviourType) { case GuardCaptain: GuardCaptainLogic(mob);