summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}