diff options
author | michi_cc <michi_cc@openttd.org> | 2008-11-02 17:42:28 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2008-11-02 17:42:28 +0000 |
commit | f649496caafb2946d982dbea84d7232e4fb3f3c9 (patch) | |
tree | 353a4af05d0d29df106a02fd720f48f4c1b32b8d | |
parent | 6d94be75e918aabdefd428abe8f46822f38d842d (diff) | |
download | openttd-f649496caafb2946d982dbea84d7232e4fb3f3c9.tar.xz |
(svn r14558) -Fix (r13957): Converting the track type of a tunnel/bridge could cause trains to get stuck.
-rw-r--r-- | src/rail_cmd.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index e7c9956ab..3b3621c46 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1393,7 +1393,8 @@ CommandCost CmdConvertRail(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) Track track = DiagDirToDiagTrack(GetTunnelBridgeDirection(tile)); if (GetTunnelBridgeReservation(tile)) { Vehicle *v = GetTrainForReservation(tile, track); - if (v != NULL) { + if (v != NULL && !HasPowerOnRail(v->u.rail.railtype, totype)) { + /* No power on new rail type, reroute. */ FreeTrainTrackReservation(v); *vehicles_affected.Append() = v; } |