From 964e7a436383e28d303486ad416ba95531705abd Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 3 May 2023 19:50:52 -0500 Subject: [PATCH] guards will now recall home if they leave city grid and have no players loaded --- src/engine/ai/MobileFSM.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index 038aa69f..87d1647c 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -198,9 +198,9 @@ public class MobileFSM { } else if (mob.lastPatrolPointIndex > mob.patrolPoints.size() - 1) { mob.lastPatrolPointIndex = 0; mob.destination = mob.patrolPoints.get(mob.lastPatrolPointIndex); + mob.lastPatrolPointIndex += 1; } MovementUtilities.aiMove(mob, mob.destination, true); - mob.lastPatrolPointIndex += 1; if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()) { for (Entry minion : mob.siegeMinionMap.entrySet()) { //make sure mob is out of combat stance @@ -312,6 +312,8 @@ public class MobileFSM { if (mob.despawned && mob.isPlayerGuard) { //override for guards CheckForRespawn(mob); + //check to send mob home for player guards to prevent exploit of dragging guards away and then teleporting + CheckToSendMobHome(mob); return; } if (!mob.isAlive()) {