summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-01-12 19:33:25 +0000
committersmatz <smatz@openttd.org>2008-01-12 19:33:25 +0000
commit74f9be8f2c1dca108b88449e6935c61442cbf829 (patch)
tree8f221b12db266dfdc18286f8af824f52d8ecedcb
parent9c9b7432420e32655465d8513109971ae0a9e224 (diff)
downloadopenttd-74f9be8f2c1dca108b88449e6935c61442cbf829.tar.xz
(svn r11821) -Fix (r11802): 'optimization assert' when removing crashed wagon in some cases
-rw-r--r--src/train_cmd.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index a8fdc8ba1..06daa39bc 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3131,20 +3131,15 @@ static void DeleteLastWagon(Vehicle *v)
delete v;
- if (track != TRACK_BIT_DEPOT && track != TRACK_BIT_WORMHOLE)
- SetSignalsOnBothDir(tile, (Track)(FIND_FIRST_BIT(track)));
-
/* Check if the wagon was on a road/rail-crossing and disable it if no
* others are on it */
DisableTrainCrossing(tile);
- if (track == TRACK_BIT_WORMHOLE) { // inside a tunnel / bridge
- TileIndex endtile = GetOtherTunnelBridgeEnd(tile);
-
- if (GetVehicleTunnelBridge(tile, endtile) != NULL) return; // tunnel / bridge is busy
-
- /* v->direction is "random", so it cannot be used to determine the direction of the track */
+ /* Update signals */
+ if (IsTileType(tile, MP_TUNNELBRIDGE) || IsTileDepotType(tile, TRANSPORT_RAIL)) {
UpdateSignalsOnSegment(tile, INVALID_DIAGDIR);
+ } else {
+ SetSignalsOnBothDir(tile, (Track)(FIND_FIRST_BIT(track)));
}
}