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.
This commit is contained in:
Jonathan G Rennison
2022-01-01 02:04:27 +00:00
parent 42b223a288
commit f658d9f1fc

View File

@@ -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) {