Browse Source

pets will stop chasing mobs that are no longer a threat to player

master
FatBoy-DOTC 1 year ago
parent
commit
4fd9a358a6
  1. 5
      src/engine/ai/MobileFSM.java

5
src/engine/ai/MobileFSM.java

@ -675,8 +675,9 @@ public class MobileFSM { @@ -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);

Loading…
Cancel
Save