1
0
Fork 0

Traffic: Fix crash in createTakeoff

Likely relates to repositioning, and a stale ‘active runway’ value.
This commit is contained in:
James Turner 2020-10-23 14:47:08 +01:00
parent 992bb81c0f
commit 9ebbfb90af

View file

@ -531,6 +531,13 @@ bool FGAIFlightPlan::createTakeOff(FGAIAircraft * ac, bool firstFlight,
apt->getDynamics()->getActiveRunway(rwyClass, 1, activeRunway, apt->getDynamics()->getActiveRunway(rwyClass, 1, activeRunway,
heading); heading);
} }
// this is Sentry issue FLIGHTGEAR-DS : happens after reposition,
// likely firstFlight is false, but activeRunway is stale
if (!apt->hasRunwayWithIdent(activeRunway)) {
SG_LOG(SG_AI, SG_WARN, "FGAIFlightPlan::createTakeOff: invalid active runway:" << activeRunway);
return false;
}
FGRunway * rwy = apt->getRunwayByIdent(activeRunway); FGRunway * rwy = apt->getRunwayByIdent(activeRunway);
if (!rwy) if (!rwy)