Fix #25460: Infinite loop when moving track design ghost queue over queue loop (#25893)

Added iteration limit to FootpathChainRideQueue based on map size (10x total tiles) as a safeguard against circular queue scenarios possible with zero clearance checks.
This commit is contained in:
frozensnowy
2026-03-14 09:00:29 +01:00
committed by GitHub
parent 1db7dae95d
commit ed76ad5606
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -4,6 +4,7 @@
- Change: [#25962] The station style dropdown now shows entrance icons next to the labels for easier selection.
- Change: [#26178] Symmetric spinning trains and legacy pre-reversed trains can no longer be reversed.
- Fix: [#10616] Quarter-tile trees cannot be placed on dry portions of half-water tiles.
- Fix: [#25460] Infinite loop when moving track design ghost queue over queue loop with zero clearances.
- Fix: [#25735] Ride synchronisation z-check works incorrectly.
- Fix: [#25962] Dropdown triangle glyphs are not optically centred.
- Fix: [#25993] Toggling “allow arbitrary ride type changes” does not resize open ride windows.
+9
View File
@@ -803,8 +803,17 @@ namespace OpenRCT2
int32_t baseZ = tileElement->GetBaseZ();
int32_t lastPathDirection = direction;
// Prevent infinite loops from circular queues (possible with zero clearance checks)
auto& gameState = getGameState();
const int32_t maxIterations = gameState.mapSize.x * gameState.mapSize.y * 10;
int32_t iterations = 0;
for (;;)
{
if (++iterations > maxIterations)
{
break;
}
if (tileElement->GetType() == TileElementType::Path)
{
lastPathElement = tileElement;