1
0
Fork 0

Codefix c05ffb2: Scale river generation max_search_nodes

The river generation AyStar pathfinder search routine could end prematurely on large numbers of flat tiles at the same height.

Scaling max_search_nodes with river length solves this issue.
pull/13365/head
SamuXarick 2025-01-23 12:19:06 +00:00
parent f7aaf8ea24
commit cf412d7866
1 changed files with 1 additions and 0 deletions

View File

@ -1297,6 +1297,7 @@ static void BuildRiver(TileIndex begin, TileIndex end, TileIndex spring, bool ma
finder.FoundEndNode = River_FoundEndNode;
finder.user_target = &end;
finder.user_data = &user_data;
finder.max_search_nodes = 1000 * DistanceManhattan(begin, end);
AyStarNode start;
start.tile = begin;