From c4446736a67a3f2d31823dd1402d8609c64d5e4b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 14 Nov 2023 22:49:58 -0600 Subject: [PATCH] shape --- src/engine/devcmd/cmds/aiInfoCmd.java | 4 ---- src/engine/mobileAI/MobAI.java | 2 +- src/engine/mobileAI/utilities/PathingUtilities.java | 4 +++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/engine/devcmd/cmds/aiInfoCmd.java b/src/engine/devcmd/cmds/aiInfoCmd.java index a6ae11bf..1276d72a 100644 --- a/src/engine/devcmd/cmds/aiInfoCmd.java +++ b/src/engine/devcmd/cmds/aiInfoCmd.java @@ -155,10 +155,6 @@ public class aiInfoCmd extends AbstractDevCmd { output += "Walking: " + ((Mob) target).isMoving() + newline; output += "Destination: " + ((Mob) target).destination + newline; output += "is Pathing: " + mob.isPathing + newline; - output += "NavPath: " + newline; - for(PathingUtilities.Node point : ((Mob) target).navPath){ - output += point.location + newline; - } ((Mob) target).isPathing = false; throwbackInfo(playerCharacter, output); } diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 812238b4..267a3e50 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -1350,7 +1350,7 @@ public class MobAI { return; } if(!mob.isPathing){ - ArrayList path = PathingUtilities.getPath(mob.loc,mob.destination); + ArrayList path = PathingUtilities.getPath(mob, mob.loc,mob.destination); if(path != null && path.size() > 0) PathingUtilities.followPath(mob,path); } diff --git a/src/engine/mobileAI/utilities/PathingUtilities.java b/src/engine/mobileAI/utilities/PathingUtilities.java index dd4d447f..7f1d5cf6 100644 --- a/src/engine/mobileAI/utilities/PathingUtilities.java +++ b/src/engine/mobileAI/utilities/PathingUtilities.java @@ -71,10 +71,12 @@ public class PathingUtilities { } return closest; } - public static ArrayList getPath(Vector3fImmutable start, Vector3fImmutable goal){ + public static ArrayList getPath(AbstractCharacter mover, Vector3fImmutable start, Vector3fImmutable goal){ ArrayList path = new ArrayList<>(); Node startNode = getClosestNode(start); Node goalNode = getClosestNode(goal); + if(goalNode == null) + move(mover,goal); Node currentNode = new Node(startNode); path.add(startNode); int attempts = 0;