mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-01 03:48:43 +00:00
(svn r20156) -Fix [FS#3937]: [YAPP] Converting a one-way block to a path signal with trains on both sides could lead to a train crash.
This commit is contained in:
parent
3ea53ff2fe
commit
9e93ee3a45
@ -314,6 +314,10 @@ Train *GetTrainForReservation(TileIndex tile, Track track)
|
||||
* have a train on it. We need FollowReservation to ignore one-way signals
|
||||
* here, as one of the two search directions will be the "wrong" way. */
|
||||
for (int i = 0; i < 2; ++i, trackdir = ReverseTrackdir(trackdir)) {
|
||||
/* If the tile has a one-way block signal in the current trackdir, skip the
|
||||
* search in this direction as the reservation can't come from this side.*/
|
||||
if (HasOnewaySignalBlockingTrackdir(tile, ReverseTrackdir(trackdir)) && !HasPbsSignalOnTrackdir(tile, trackdir)) continue;
|
||||
|
||||
FindTrainOnTrackInfo ftoti;
|
||||
ftoti.res = FollowReservation(GetTileOwner(tile), rts, tile, trackdir, true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user