Fix crash which could occur when trying to extend invalidated reservation

When using realistic braking
pull/642/head
Jonathan G Rennison 5 months ago
parent c8d82eb988
commit 091fb0da44

@ -1016,7 +1016,11 @@ static void AdvanceLookAheadPosition(Train *v)
if (v->lookahead->current_position == v->lookahead->next_extend_position) {
SetTrainReservationLookaheadEnd(v);
/* This may clear the lookahead if it has become invalid */
TryLongReserveChooseTrainTrackFromReservationEnd(v, true);
if (v->lookahead == nullptr) return;
v->lookahead->SetNextExtendPositionIfUnset();
}
}

Loading…
Cancel
Save