mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-10 21:02:36 +01:00
Don't cancel pathfinding when despawned
This commit is contained in:
parent
23fab58673
commit
fee41a4a00
@ -101,10 +101,8 @@ public class CitizensNavigator implements Navigator, Runnable {
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (!isNavigating())
|
if (!isNavigating())
|
||||||
return;
|
return;
|
||||||
if (!npc.isSpawned()) {
|
if (!npc.isSpawned())
|
||||||
stopNavigating(CancelReason.NPC_DESPAWNED);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
if (updateStationaryStatus())
|
if (updateStationaryStatus())
|
||||||
return;
|
return;
|
||||||
updatePathfindingRange();
|
updatePathfindingRange();
|
||||||
@ -154,9 +152,9 @@ public class CitizensNavigator implements Navigator, Runnable {
|
|||||||
}
|
}
|
||||||
localParams = defaultParams.clone();
|
localParams = defaultParams.clone();
|
||||||
PathStrategy newStrategy;
|
PathStrategy newStrategy;
|
||||||
if (Setting.USE_NEW_PATHFINDER.asBoolean())
|
if (Setting.USE_NEW_PATHFINDER.asBoolean()) {
|
||||||
newStrategy = new AStarNavigationStrategy(npc, target, localParams);
|
newStrategy = new AStarNavigationStrategy(npc, target, localParams);
|
||||||
else
|
} else
|
||||||
newStrategy = new MCNavigationStrategy(npc, target, localParams);
|
newStrategy = new MCNavigationStrategy(npc, target, localParams);
|
||||||
switchStrategyTo(newStrategy);
|
switchStrategyTo(newStrategy);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user