From 7701d4e81305ee302a2498849513e7146db21866 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 27 Jan 2023 19:03:35 +0000 Subject: [PATCH] Ensure secondary track type is valid when switching to dual mode by removing piece --- src/rail_cmd.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index e9c71fe084..c73b1b0bb7 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1051,6 +1051,10 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, } else { SetTrackBits(tile, present); SetTrackReservation(tile, GetRailReservationTrackBits(tile) & present); + + if (present == TRACK_BIT_HORZ || present == TRACK_BIT_VERT) { + SetSecondaryRailType(tile, GetRailType(tile)); + } } } break;