Check pathfinding range while pathfinding
This commit is contained in:
parent
417f0f1691
commit
b5c433c594
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue