Skip to content

Commit 578d9f6

Browse files
author
markb5
committed
don't queue naive waypoint if already there
1 parent 2ff38b8 commit 578d9f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/engine/entity/PathingEntity.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,11 @@ export default abstract class PathingEntity extends Entity {
448448
angle = this.target.angle;
449449
}
450450
const waypoints = findNaivePath(this.level, this.x, this.z, this.target.x, this.target.z, this.width, this.length, this.target.width, this.target.length, angle, CollisionType.NORMAL);
451-
this.queueWaypoints(waypoints);
451+
452+
const { x, z } = CoordGrid.unpackCoord(waypoints[0]);
453+
if (x !== this.x || z !== this.z) {
454+
this.queueWaypoints(waypoints);
455+
}
452456
}
453457

454458
pathToTarget(): void {

0 commit comments

Comments
 (0)