From 8a3a9af84f5187d2a3f17c464f9b0540008b4828 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 6 Sep 2024 01:15:25 +0100 Subject: [PATCH] Fix 8d62a8f0: Road stop variable 6B crashing for road stop preview in GUI --- src/newgrf_roadstop.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp index 16d38a0991..66c818c5f1 100644 --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -184,6 +184,7 @@ uint32_t RoadStopScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] u /* 16 bit road stop ID of nearby tiles */ case 0x6B: { + if (this->tile == INVALID_TILE) return 0xFFFFFFFF; TileIndex nearby_tile = GetNearbyTile(parameter, this->tile); if (!IsAnyRoadStopTile(nearby_tile)) return 0xFFFFFFFF;