changeset 8257:38d56fa7b6f7 draft

(svn r11821) -Fix (r11802): 'optimization assert' when removing crashed wagon in some cases
author smatz <smatz@openttd.org>
date Sat, 12 Jan 2008 19:33:25 +0000
parents 3ddf51e9aa83
children 6017c5ebeb7e
files src/train_cmd.cpp
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3131,20 +3131,15 @@
 
 	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)));
 	}
 }