mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-06 19:27:16 +01:00
(svn r21836) -Fix: when a train was reversed while inside a tunnel/bridge, it wouldn't have (re)set the GOINGUP/DOWN bits after leaving the tunnel/bridge
This commit is contained in:
parent
772de6b52d
commit
c0b051eb33
@ -3146,6 +3146,11 @@ static void TrainController(Train *v, Vehicle *nomove)
|
|||||||
TryReserveRailTrack(gp.new_tile, DiagDirToDiagTrack(GetTunnelBridgeDirection(gp.new_tile)));
|
TryReserveRailTrack(gp.new_tile, DiagDirToDiagTrack(GetTunnelBridgeDirection(gp.new_tile)));
|
||||||
CheckNextTrainTile(v);
|
CheckNextTrainTile(v);
|
||||||
}
|
}
|
||||||
|
/* Prevent v->UpdateInclination() being called with wrong parameters.
|
||||||
|
* This could happen if the train was reversed inside the tunnel/bridge. */
|
||||||
|
if (gp.old_tile == gp.new_tile) {
|
||||||
|
gp.old_tile = GetOtherTunnelBridgeEnd(gp.old_tile);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
v->x_pos = gp.x;
|
v->x_pos = gp.x;
|
||||||
v->y_pos = gp.y;
|
v->y_pos = gp.y;
|
||||||
|
Loading…
Reference in New Issue
Block a user