From d5ff6b4156c24cebbd4a7027f76d9c98aa4bb295 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 6 Sep 2024 11:14:34 +0100 Subject: [PATCH] Fix 8d62a8f0: Road stop variable 6B crashing for road stop preview in GUI (#12930) --- 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;