diff --git a/src/pbs.cpp b/src/pbs.cpp index 0b8d71fd0e..98e67d6284 100644 --- a/src/pbs.cpp +++ b/src/pbs.cpp @@ -996,8 +996,13 @@ void SetTrainReservationLookaheadEnd(Train *v) return; } + if (v->lookahead->lookahead_end_position > v->lookahead->reservation_end_position) return; + int32 threshold = v->lookahead->current_position + 24; uint8 known_signals_ahead = 1; + if (v->IsInDepot()) { + known_signals_ahead = _extra_aspects + 1; + } for (const TrainReservationLookAheadItem &item : v->lookahead->items) { if (item.end >= v->lookahead->reservation_end_position) break; if (item.type == TRLIT_SIGNAL) { diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 04c9dc464d..d52c05458c 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -4007,7 +4007,10 @@ static bool IsReservationLookAheadLongEnough(const Train *v, const ChooseTrainTr if (v->lookahead->reservation_end_position >= v->lookahead->current_position + v->reverse_distance - 1) return true; } - if (v->lookahead->lookahead_end_position <= v->lookahead->reservation_end_position && _settings_game.vehicle.realistic_braking_aspect_limited == TRBALM_ON) return true; + if (v->lookahead->lookahead_end_position <= v->lookahead->reservation_end_position && _settings_game.vehicle.realistic_braking_aspect_limited == TRBALM_ON && + v->lookahead->reservation_end_position > v->lookahead->current_position + 24) { + return true; + } TrainDecelerationStats stats(v, v->lookahead->cached_zpos);