mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
Fix lookahead init inside a signalled tunnel/bridge only filling interior
This commit is contained in:
parent
9506a33443
commit
87c87649b8
@ -4119,7 +4119,7 @@ bool TryPathReserve(Train *v, bool mark_as_stuck, bool first_tile_okay)
|
||||
|
||||
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
||||
/* Initialise a lookahead if there isn't one already */
|
||||
if (v->lookahead == nullptr) TryCreateLookAheadForTrainInTunnelBridge(v);
|
||||
if (v->lookahead == nullptr) FillTrainReservationLookAhead(v);
|
||||
if (v->lookahead != nullptr && !LookaheadWithinCurrentTunnelBridge(v)) {
|
||||
/* Try to extend the reservation beyond the tunnel/bridge exit */
|
||||
TryLongReserveChooseTrainTrackFromReservationEnd(v, true);
|
||||
@ -4639,7 +4639,7 @@ static bool IsTooCloseBehindTrain(Train *t, TileIndex tile, uint16 distance, boo
|
||||
|
||||
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
||||
if (unlikely(t->lookahead == nullptr)) {
|
||||
TryCreateLookAheadForTrainInTunnelBridge(t);
|
||||
FillTrainReservationLookAhead(t);
|
||||
}
|
||||
if (likely(t->lookahead != nullptr)) {
|
||||
if (LookaheadWithinCurrentTunnelBridge(t)) {
|
||||
@ -4726,7 +4726,7 @@ static bool CheckTrainStayInWormHolePathReserve(Train *t, TileIndex tile)
|
||||
|
||||
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
||||
if (unlikely(t->lookahead == nullptr)) {
|
||||
TryCreateLookAheadForTrainInTunnelBridge(t);
|
||||
FillTrainReservationLookAhead(t);
|
||||
}
|
||||
if (likely(t->lookahead != nullptr)) {
|
||||
if (!HasAcrossTunnelBridgeReservation(tile)) return false;
|
||||
|
Loading…
Reference in New Issue
Block a user