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() {
|
||||
if (!isNavigating())
|
||||
return;
|
||||
if (!npc.isSpawned()) {
|
||||
stopNavigating(CancelReason.NPC_DESPAWNED);
|
||||
if (!npc.isSpawned())
|
||||
return;
|
||||
}
|
||||
if (updateStationaryStatus())
|
||||
return;
|
||||
updatePathfindingRange();
|
||||
@ -154,9 +152,9 @@ public class CitizensNavigator implements Navigator, Runnable {
|
||||
}
|
||||
localParams = defaultParams.clone();
|
||||
PathStrategy newStrategy;
|
||||
if (Setting.USE_NEW_PATHFINDER.asBoolean())
|
||||
if (Setting.USE_NEW_PATHFINDER.asBoolean()) {
|
||||
newStrategy = new AStarNavigationStrategy(npc, target, localParams);
|
||||
else
|
||||
} else
|
||||
newStrategy = new MCNavigationStrategy(npc, target, localParams);
|
||||
switchStrategyTo(newStrategy);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user