From d66a7049e81ef589f1b1625e1789c22d4d85f2f4 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 9 Sep 2023 09:35:03 -0500 Subject: [PATCH] guard walking bug fix --- src/engine/mobileAI/MobAI.java | 8 ++++---- src/engine/mobileAI/utilities/MovementUtilities.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 3c3f5d46..adc324ad 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -740,7 +740,7 @@ public class MobAI { return; mob.destination = mob.guardCaptain.getLoc(); - MovementUtilities.moveToLocation(mob, mob.destination, 5); + MovementUtilities.moveToLocation(mob, mob.destination, 5, false); } else chaseTarget(mob); break; @@ -891,7 +891,7 @@ public class MobAI { if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { if (mob.getRange() > 15) { mob.destination = mob.getCombatTarget().getLoc(); - MovementUtilities.moveToLocation(mob, mob.destination, 0); + MovementUtilities.moveToLocation(mob, mob.destination, 0, false); } else { //check if building @@ -900,11 +900,11 @@ public class MobAI { case PlayerCharacter: case Mob: mob.destination = MovementUtilities.GetDestinationToCharacter(mob, (AbstractCharacter) mob.getCombatTarget()); - MovementUtilities.moveToLocation(mob, mob.destination, mob.getRange() + 1); + MovementUtilities.moveToLocation(mob, mob.destination, mob.getRange() + 1, false); break; case Building: mob.destination = mob.getCombatTarget().getLoc(); - MovementUtilities.moveToLocation(mob, mob.getCombatTarget().getLoc(), 0); + MovementUtilities.moveToLocation(mob, mob.getCombatTarget().getLoc(), 0, false); break; } } diff --git a/src/engine/mobileAI/utilities/MovementUtilities.java b/src/engine/mobileAI/utilities/MovementUtilities.java index 9bda3497..e0569390 100644 --- a/src/engine/mobileAI/utilities/MovementUtilities.java +++ b/src/engine/mobileAI/utilities/MovementUtilities.java @@ -147,7 +147,7 @@ public class MovementUtilities { return aiAgent.getLoc().ClosestPointOnLine(aggroTarget.getLoc(), aggroTarget.getEndLoc()); } - public static void moveToLocation(Mob agent, Vector3fImmutable newLocation, float offset) { + public static void moveToLocation(Mob agent, Vector3fImmutable newLocation, float offset, boolean isWalking) { try { //don't move farther than 30 units from player. @@ -158,7 +158,7 @@ public class MovementUtilities { agent.setFaceDir(newLoc.subtract2D(agent.getLoc()).normalize()); - aiMove(agent, newLoc, false); + aiMove(agent, newLoc, isWalking); } catch (Exception e) { Logger.error(e.toString()); }