summaryrefslogtreecommitdiff
path: root/src/pbs.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2010-03-14 20:57:23 +0000
committermichi_cc <michi_cc@openttd.org>2010-03-14 20:57:23 +0000
commit8c477604eb09028b2dca78b45eb4ffcc8aa10c19 (patch)
treeae84eb7efcac22565fa4beb3879ac50606921b0a /src/pbs.cpp
parente5cded6e3600f9363c7b64911292758602afc10d (diff)
downloadopenttd-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/pbs.cpp')
-rw-r--r--src/pbs.cpp5
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;
}