From fee41a4a0015733617b4f39248fbd45b9c6df05c Mon Sep 17 00:00:00 2001 From: fullwall Date: Mon, 4 Feb 2013 10:14:50 +0800 Subject: [PATCH] Don't cancel pathfinding when despawned --- .../java/net/citizensnpcs/npc/ai/CitizensNavigator.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java b/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java index 49ab21c50..cd964fff9 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java +++ b/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java @@ -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); }