Increased position lerp tolerance to 0.1 yards -- should help prevent entities getting stuck at waypoints

This commit is contained in:
Collin Smith 2019-11-19 16:48:42 -08:00
parent b6bf8773a1
commit 40d9b56c33

View File

@ -53,7 +53,7 @@ public class PathfindSystem extends IteratingSystem {
if (part == 0) break;
position.lerp(target, part / targetLen);
traveled += part;
if (MathUtils.isEqual(part, targetLen)) {
if (MathUtils.isEqual(part, targetLen, 0.1f)) {
if (targets.hasNext()) {
MapGraph.Point2 next = targets.next();
target.set(next.x, next.y);