mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 03:25:13 +01:00
Set pathfinding range on strategy switch
This commit is contained in:
parent
7229958dcf
commit
c538a18471
@ -143,6 +143,7 @@ public class CitizensNavigator implements Navigator, Runnable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
localParams = defaultParams.clone();
|
localParams = defaultParams.clone();
|
||||||
|
updatePathfindingRange();
|
||||||
PathStrategy newStrategy = new MCTargetStrategy(npc, target, aggressive, localParams);
|
PathStrategy newStrategy = new MCTargetStrategy(npc, target, aggressive, localParams);
|
||||||
switchStrategyTo(newStrategy);
|
switchStrategyTo(newStrategy);
|
||||||
}
|
}
|
||||||
@ -161,6 +162,7 @@ public class CitizensNavigator implements Navigator, Runnable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
localParams = defaultParams.clone();
|
localParams = defaultParams.clone();
|
||||||
|
updatePathfindingRange();
|
||||||
PathStrategy newStrategy;
|
PathStrategy newStrategy;
|
||||||
if (localParams.useNewPathfinder()) {
|
if (localParams.useNewPathfinder()) {
|
||||||
newStrategy = new AStarNavigationStrategy(npc, target, localParams);
|
newStrategy = new AStarNavigationStrategy(npc, target, localParams);
|
||||||
|
Loading…
Reference in New Issue
Block a user