mirror of https://github.com/OpenTTD/OpenTTD
(svn r19425) -Fix: [YAPP] A train on a bridge/tunnel was not always found when checking for trains on a reserved path.
parent
e5cded6e36
commit
8c477604eb
|
@ -287,6 +287,11 @@ PBSTileInfo FollowTrainReservation(const Train *v, Vehicle **train_on_res)
|
||||||
if (ftoti.best != NULL) *train_on_res = ftoti.best->First();
|
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;
|
return ftoti.res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue