diff options
author | michi_cc <michi_cc@openttd.org> | 2010-03-14 20:57:23 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2010-03-14 20:57:23 +0000 |
commit | 8c477604eb09028b2dca78b45eb4ffcc8aa10c19 (patch) | |
tree | ae84eb7efcac22565fa4beb3879ac50606921b0a /src | |
parent | e5cded6e3600f9363c7b64911292758602afc10d (diff) | |
download | openttd-8c477604eb09028b2dca78b45eb4ffcc8aa10c19.tar.xz |
(svn r19425) -Fix: [YAPP] A train on a bridge/tunnel was not always found when checking for trains on a reserved path.
Diffstat (limited to 'src')
-rw-r--r-- | src/pbs.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pbs.cpp b/src/pbs.cpp index e7834ef80..e3b8fa961 100644 --- a/src/pbs.cpp +++ b/src/pbs.cpp @@ -287,6 +287,11 @@ PBSTileInfo FollowTrainReservation(const Train *v, Vehicle **train_on_res) if (ftoti.best != NULL) *train_on_res = ftoti.best->First(); } } + if (*train_on_res == NULL && IsTileType(ftoti.res.tile, MP_TUNNELBRIDGE)) { + /* The target tile is a bridge/tunnel, also check the other end tile. */ + FindVehicleOnPos(GetOtherTunnelBridgeEnd(ftoti.res.tile), &ftoti, FindTrainOnTrackEnum); + if (ftoti.best != NULL) *train_on_res = ftoti.best->First(); + } } return ftoti.res; } |