Check pathfinding range while pathfinding

This commit is contained in:
fullwall 2016-09-05 19:13:01 +08:00
parent 417f0f1691
commit b5c433c594
1 changed files with 4 additions and 0 deletions

View File

@ -148,6 +148,10 @@ public class CitizensNavigator implements Navigator, Runnable {
updateMountedStatus();
if (!isNavigating() || !npc.isSpawned() || paused)
return;
if (Math.pow(localParams.range(), 2) < npc.getStoredLocation().distanceSquared(getTargetAsLocation())) {
stopNavigating(CancelReason.STUCK);
return;
}
if (updateStationaryStatus())
return;