shape
This commit is contained in:
@@ -155,10 +155,6 @@ public class aiInfoCmd extends AbstractDevCmd {
|
|||||||
output += "Walking: " + ((Mob) target).isMoving() + newline;
|
output += "Walking: " + ((Mob) target).isMoving() + newline;
|
||||||
output += "Destination: " + ((Mob) target).destination + newline;
|
output += "Destination: " + ((Mob) target).destination + newline;
|
||||||
output += "is Pathing: " + mob.isPathing + 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;
|
((Mob) target).isPathing = false;
|
||||||
throwbackInfo(playerCharacter, output);
|
throwbackInfo(playerCharacter, output);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1350,7 +1350,7 @@ public class MobAI {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!mob.isPathing){
|
if(!mob.isPathing){
|
||||||
ArrayList<PathingUtilities.Node> path = PathingUtilities.getPath(mob.loc,mob.destination);
|
ArrayList<PathingUtilities.Node> path = PathingUtilities.getPath(mob, mob.loc,mob.destination);
|
||||||
if(path != null && path.size() > 0)
|
if(path != null && path.size() > 0)
|
||||||
PathingUtilities.followPath(mob,path);
|
PathingUtilities.followPath(mob,path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,10 +71,12 @@ public class PathingUtilities {
|
|||||||
}
|
}
|
||||||
return closest;
|
return closest;
|
||||||
}
|
}
|
||||||
public static ArrayList<Node> getPath(Vector3fImmutable start, Vector3fImmutable goal){
|
public static ArrayList<Node> getPath(AbstractCharacter mover, Vector3fImmutable start, Vector3fImmutable goal){
|
||||||
ArrayList<Node> path = new ArrayList<>();
|
ArrayList<Node> path = new ArrayList<>();
|
||||||
Node startNode = getClosestNode(start);
|
Node startNode = getClosestNode(start);
|
||||||
Node goalNode = getClosestNode(goal);
|
Node goalNode = getClosestNode(goal);
|
||||||
|
if(goalNode == null)
|
||||||
|
move(mover,goal);
|
||||||
Node currentNode = new Node(startNode);
|
Node currentNode = new Node(startNode);
|
||||||
path.add(startNode);
|
path.add(startNode);
|
||||||
int attempts = 0;
|
int attempts = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user