In the existing version, returning to a junction in the pathfind history is considered a loop. This is not useful as it prevents the pathfinding from backtracking, which is what the pathfind_history is intended to allow.
Updated to consider it a loop only when returning to a junction with no more edges left to try.
When choosing a direction at a junction in pathfind_history (with no untried directions) the existing path finding falls back to aimless movement.
This change makes the pathfinding try again.
Useful for adjusting to path changes by the player and recovering from a stuck position in a savegame due to earlier bad pathfinding.
Now that the heuristic search uses the pathfind_history for loop detection it is important that when the pathfind_goal is reset the pathfind_history gets reset before calling the heuristic search.
This is applicable for overlaid paths placed with zero clearance.
Previously the pathfinding only used the first path element.
Notes:
1. Logic related to path slope still only uses the the first path element. Overlaying path elements with the same base height but different slopes may cause pathfinding glitches.
2. The heuristic search already uses a similar approach - the inconsistency could have caused pathfinding glitches.
Issue was caused by an incorrect read (only 1 byte instead of 2) of the legacy banner data during object loading. Note this would have caused the scenery_tab_id and string table to possibly have corrupted data.
The feature of disabling the land rights buying buttons depends on the
land rights being accounted for, but the function that calculates these
was not called when loading saved games. Therefore it would often make
it impossible to buy land after loading a saved game.
Previously multi tiled placements would only check for one free element before placing. This would cause a crash when it failed to allocate the next element on maps that were close to reaching their full capacity. Renamed sub_68B044 to map_check_free_elements_and_organise and gave it an argument value to check for enough free elements.