Fix: Changing NPF max search nodes while in-game had no effect (#12194)

(cherry picked from commit f845b4bbc3)
pull/684/head
SamuXarick 2 months ago committed by Jonathan G Rennison
parent 5c345f55e2
commit afaf452534

@ -1039,6 +1039,10 @@ static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start
/* Initialize user_data */ /* Initialize user_data */
_npf_aystar.user_data = user; _npf_aystar.user_data = user;
/* We will limit the number of nodes for now, until we have a better
* solution to really fix performance */
_npf_aystar.max_search_nodes = _settings_game.pf.npf.npf_max_search_nodes;
/* GO! */ /* GO! */
[[maybe_unused]] int r = _npf_aystar.Main(); [[maybe_unused]] int r = _npf_aystar.Main();
assert(r != AYSTAR_STILL_BUSY); assert(r != AYSTAR_STILL_BUSY);
@ -1112,9 +1116,6 @@ void InitializeNPF()
} }
_npf_aystar.loops_per_tick = 0; _npf_aystar.loops_per_tick = 0;
_npf_aystar.max_path_cost = 0; _npf_aystar.max_path_cost = 0;
/* We will limit the number of nodes for now, until we have a better
* solution to really fix performance */
_npf_aystar.max_search_nodes = _settings_game.pf.npf.npf_max_search_nodes;
} }
static void NPFFillWithOrderData(NPFFindStationOrTileData *fstd, const Vehicle *v, bool reserve_path = false) static void NPFFillWithOrderData(NPFFindStationOrTileData *fstd, const Vehicle *v, bool reserve_path = false)

Loading…
Cancel
Save