From fb266722ba4b46e4ec6ad89658342530bb4760c5 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 24 Sep 2012 00:36:47 +0100 Subject: [PATCH] Parking: another segfault edge-case. Again, when there's no parking/ground-net, tolerate this. --- src/AIModel/AIFlightPlanCreate.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/AIModel/AIFlightPlanCreate.cxx b/src/AIModel/AIFlightPlanCreate.cxx index 80629ac28..30a698972 100644 --- a/src/AIModel/AIFlightPlanCreate.cxx +++ b/src/AIModel/AIFlightPlanCreate.cxx @@ -1012,6 +1012,14 @@ bool FGAIFlightPlan::createParking(FGAIAircraft * ac, FGAirport * apt, double vTaxi = ac->getPerformance()->vTaxi(); double vTaxiReduced = vTaxi * (2.0 / 3.0); FGParking* parking = apt->getDynamics()->getParking(gateId); + if (!parking) { + wpt = createOnGround(ac, "END-Parking", apt->geod(), aptElev, + vTaxiReduced); + pushBackWaypoint(wpt); + + return true; + } + double heading = SGMiscd::normalizePeriodic(0, 360, parking->getHeading() + 180.0); double az; // unused SGGeod pos; -- 2.39.5