From bde3e54fd43a667bc8ba824fc839e671daf7eeba Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 15 May 2024 20:05:18 -0500 Subject: [PATCH] mob AI work --- src/engine/mobileAI/MobAI.java | 10 +++++----- src/engine/mobileAI/utilities/MovementUtilities.java | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 571532a0..2afce504 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -85,7 +85,7 @@ public class MobAI { break; } - mob.updateLocation(); + //mob.updateLocation(); } catch (Exception e) { Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackTarget" + " " + e.getMessage()); @@ -305,7 +305,7 @@ public class MobAI { if (minion.getKey().despawned == false) { if (MovementUtilities.canMove(minion.getKey())) { Vector3f minionOffset = Formation.getOffset(2, minion.getValue() + 3); - minion.getKey().updateLocation(); + //minion.getKey().updateLocation(); Vector3fImmutable formationPatrolPoint = new Vector3fImmutable(mob.destination.x + minionOffset.x, mob.destination.y, mob.destination.z + minionOffset.z); MovementUtilities.aiMove(minion.getKey(), formationPatrolPoint, true); } @@ -810,7 +810,7 @@ public class MobAI { if (!MovementUtilities.canMove(mob)) return; - mob.updateLocation(); + //mob.updateLocation(); switch (mob.behaviourType) { @@ -1029,7 +1029,7 @@ public class MobAI { } } mob.updateMovementState(); - mob.updateLocation(); + //mob.updateLocation(); } catch (Exception e) { Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: chaseTarget" + " " + e.getMessage()); } @@ -1384,7 +1384,7 @@ public class MobAI { if (minion.getKey().despawned == false) { if (MovementUtilities.canMove(minion.getKey())) { Vector3f minionOffset = Formation.getOffset(2, minion.getValue() + 3); - minion.getKey().updateLocation(); + //minion.getKey().updateLocation(); Vector3fImmutable formationPatrolPoint = new Vector3fImmutable(mob.destination.x + minionOffset.x, mob.destination.y, mob.destination.z + minionOffset.z); MovementUtilities.aiMove(minion.getKey(), formationPatrolPoint, true); } diff --git a/src/engine/mobileAI/utilities/MovementUtilities.java b/src/engine/mobileAI/utilities/MovementUtilities.java index b8d262f1..222178c1 100644 --- a/src/engine/mobileAI/utilities/MovementUtilities.java +++ b/src/engine/mobileAI/utilities/MovementUtilities.java @@ -144,6 +144,7 @@ public class MovementUtilities { public static void aiMove(Mob agent, Vector3fImmutable vect, boolean isWalking) { + agent.updateLocation(); //update our walk/run state. if (isWalking && !agent.isWalk()) { agent.setWalkMode(true);