diff options
author | michi_cc <michi_cc@openttd.org> | 2012-03-25 23:42:49 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2012-03-25 23:42:49 +0000 |
commit | f8b62a3c7a9191238d7dbfc3681edcdb6a781d72 (patch) | |
tree | 21d6855542cbce75986e538ca761d217f4742878 /src/pbs.cpp | |
parent | 1adb9a5c85f3773d3163b056ad0ed13a97347276 (diff) | |
download | openttd-f8b62a3c7a9191238d7dbfc3681edcdb6a781d72.tar.xz |
(svn r24071) -Fix [FS#5093]: Reversing trains while they were entering or leaving a depot could lead to stuck trains.
Diffstat (limited to 'src/pbs.cpp')
-rw-r--r-- | src/pbs.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pbs.cpp b/src/pbs.cpp index 01e7b2f37..3dbd5b883 100644 --- a/src/pbs.cpp +++ b/src/pbs.cpp @@ -369,7 +369,8 @@ Train *GetTrainForReservation(TileIndex tile, Track track) */ bool IsSafeWaitingPosition(const Train *v, TileIndex tile, Trackdir trackdir, bool include_line_end, bool forbid_90deg) { - if (IsRailDepotTile(tile)) return true; + /* A depot is safe if we enter it, but not when we exit. */ + if (IsRailDepotTile(tile) && TrackdirToExitdir(trackdir) != GetRailDepotDirection(tile)) return true; if (IsTileType(tile, MP_RAILWAY)) { /* For non-pbs signals, stop on the signal tile. */ |