Set pathfinding range on strategy switch

This commit is contained in:
fullwall 2013-10-20 00:11:53 +08:00
parent 7229958dcf
commit c538a18471

View File

@ -143,6 +143,7 @@ public class CitizensNavigator implements Navigator, Runnable {
return;
}
localParams = defaultParams.clone();
updatePathfindingRange();
PathStrategy newStrategy = new MCTargetStrategy(npc, target, aggressive, localParams);
switchStrategyTo(newStrategy);
}
@ -161,6 +162,7 @@ public class CitizensNavigator implements Navigator, Runnable {
return;
}
localParams = defaultParams.clone();
updatePathfindingRange();
PathStrategy newStrategy;
if (localParams.useNewPathfinder()) {
newStrategy = new AStarNavigationStrategy(npc, target, localParams);