(svn r9109) [cbh] -Fix: Stabilize the reversing of trains on bridges/bridgeheads a little (it still crashes at times however). Also re-allow the construction of signals on bridgeheads custombridgeheads
authorcelestar
Sun, 11 Mar 2007 09:28:58 +0000
branchcustombridgeheads
changeset 5651 335d9bd345b0
parent 5650 aefc131bf5ce
(svn r9109) [cbh] -Fix: Stabilize the reversing of trains on bridges/bridgeheads a little (it still crashes at times however). Also re-allow the construction of signals on bridgeheads
src/bridge_cmd.cpp
src/rail_cmd.cpp
src/train_cmd.cpp
--- a/src/bridge_cmd.cpp	Mon Jan 15 20:14:06 2007 +0000
+++ b/src/bridge_cmd.cpp	Sun Mar 11 09:28:58 2007 +0000
@@ -1018,7 +1018,7 @@
 
 	if (v->direction == DiagDirToDir(ReverseDiagDir(dir))) {
 		/* We are entering the bridge head from the bridge itself */
-		if (v->u.rail.track == TRACK_BIT_WORMHOLE) {
+		if (v->u.rail.track == TRACK_BIT_WORMHOLE && (tile == TileVirtXY(v->x_pos, v->y_pos))) {
 			/* Get the vehicle out of the wormhole, the track will be chosen later
 			   by the pathfinder */
 			v->tile = tile;
--- a/src/rail_cmd.cpp	Mon Jan 15 20:14:06 2007 +0000
+++ b/src/rail_cmd.cpp	Sun Mar 11 09:28:58 2007 +0000
@@ -654,7 +654,7 @@
 	pre_signal = HASBIT(p1, 3);
 
 	if (!ValParamTrackOrientation(track) ||
-			!(IsTileType(tile, MP_RAILWAY) /* || IsTileType(tile, MP_RAILWAY_BRIDGE) */ ) ||
+			!(IsTileType(tile, MP_RAILWAY) || IsTileType(tile, MP_RAILWAY_BRIDGE) ) ||
 			!EnsureNoVehicle(tile)) {
 		return CMD_ERROR;
 	}
--- a/src/train_cmd.cpp	Mon Jan 15 20:14:06 2007 +0000
+++ b/src/train_cmd.cpp	Sun Mar 11 09:28:58 2007 +0000
@@ -3059,6 +3059,7 @@
 			/* left tunnel/bridge wormhole */
 			dir = v->direction;
 			enterdir = INVALID_DIAGDIR;
+			entering_new_tile = true;
 			if (IsBridgeTile(gp.new_tile) && res & 0x4) {
 				/* ok we have just left the bridge (because the status was "onbridge" before and we got
 				a return value of 4 from VehicleEnterTile. we know the enterdir from the bridge ramp