# HG changeset patch # User celestar # Date 1173605338 0 # Node ID 335d9bd345b0a1e62dab333c233154e4f6efa7d6 # Parent aefc131bf5ce8b518762133741ae0a092a7bbd2c (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 diff -r aefc131bf5ce -r 335d9bd345b0 src/bridge_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; diff -r aefc131bf5ce -r 335d9bd345b0 src/rail_cmd.cpp --- 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; } diff -r aefc131bf5ce -r 335d9bd345b0 src/train_cmd.cpp --- 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