From f658d9f1fcc88453361a0861ab528752b8998978 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 1 Jan 2022 02:04:27 +0000 Subject: [PATCH] Fix rail drag remove removing track even with an unremovable signal This occurred when a removing a signal was blocked due to realistic braking moving train restrictions. This resulted in incorrect signal infrastructure totals and MP desyncs. --- src/rail_cmd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 63b6631d17..db29570382 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1002,7 +1002,9 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, /* Charge extra to remove signals on the track, if they are there */ if (HasSignalOnTrack(tile, track)) { - cost.AddCost(DoCommand(tile, track, 0, flags, CMD_REMOVE_SIGNALS)); + CommandCost ret_remove_signals = DoCommand(tile, track, 0, flags, CMD_REMOVE_SIGNALS); + if (ret_remove_signals.Failed()) return ret_remove_signals; + cost.AddCost(ret_remove_signals); } if (flags & DC_EXEC) {