(svn r11821) -Fix (r11802): 'optimization assert' when removing crashed wagon in some cases
authorsmatz
Sat, 12 Jan 2008 19:33:25 +0000
changeset 8257 3151fdbc73f9
parent 8256 1ec04ca06ffe
child 8258 9fa31acb07bc
(svn r11821) -Fix (r11802): 'optimization assert' when removing crashed wagon in some cases
src/train_cmd.cpp
--- a/src/train_cmd.cpp	Sat Jan 12 19:24:58 2008 +0000
+++ b/src/train_cmd.cpp	Sat Jan 12 19:33:25 2008 +0000
@@ -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)));
 	}
 }