From c719ba560efd41d7317d1fb7531fcc003c43db2c Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sat, 5 Nov 2022 12:46:19 -0600 Subject: [PATCH] Fix 03cc0d6: Mark level crossings dirty when removing road from them, not from bridges (#10138) --- src/road_cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index b76f3e8e70..8fa060e173 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -380,8 +380,6 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec uint len = GetTunnelBridgeLength(other_end, tile) + 2; cost.AddCost(len * 2 * RoadClearCost(existing_rt)); if (flags & DC_EXEC) { - MarkDirtyAdjacentLevelCrossingTiles(tile, GetCrossingRoadAxis(tile)); - /* A full diagonal road tile has two road bits. */ UpdateCompanyRoadInfrastructure(existing_rt, GetRoadOwner(tile, rtt), -(int)(len * 2 * TUNNELBRIDGE_TRACKBIT_FACTOR)); @@ -504,6 +502,8 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec } if (flags & DC_EXEC) { + MarkDirtyAdjacentLevelCrossingTiles(tile, GetCrossingRoadAxis(tile)); + /* A full diagonal road tile has two road bits. */ UpdateCompanyRoadInfrastructure(existing_rt, GetRoadOwner(tile, rtt), -2);