1
0
Fork 0

TrafficL Avoid crash on invalid active runway

Work-around + log message when the AI flight has an invalid
arrival runway.
This commit is contained in:
James Turner 2021-08-04 09:08:02 +01:00
parent dab9e6ba5f
commit f72983e1a6

View file

@ -989,6 +989,11 @@ bool FGAIFlightPlan::createLanding(FGAIAircraft * ac, FGAirport * apt,
double decelMetric = decel * SG_KT_TO_MPS; double decelMetric = decel * SG_KT_TO_MPS;
char buffer[12]; char buffer[12];
if (!apt->hasRunwayWithIdent(activeRunway)) {
SG_LOG(SG_AI, SG_WARN, "FGAIFlightPlan::createLanding: No such runway " << activeRunway << " at " << apt->ident());
return false;
}
FGRunway * rwy = apt->getRunwayByIdent(activeRunway); FGRunway * rwy = apt->getRunwayByIdent(activeRunway);
if (!rwy) if (!rwy)
return false; return false;