Traffic: Fix crash in createTakeoff
Likely relates to repositioning, and a stale ‘active runway’ value.
This commit is contained in:
parent
992bb81c0f
commit
9ebbfb90af
1 changed files with 7 additions and 0 deletions
|
@ -531,6 +531,13 @@ bool FGAIFlightPlan::createTakeOff(FGAIAircraft * ac, bool firstFlight,
|
|||
apt->getDynamics()->getActiveRunway(rwyClass, 1, activeRunway,
|
||||
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);
|
||||
if (!rwy)
|
||||
|
|
Loading…
Add table
Reference in a new issue