X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIFlightPlanCreatePushBack.cxx;h=5dc01732874013e880a413e0f8f333d5724834fe;hb=de35bbe4ed350bc3e90f66a11039e983587c5ea0;hp=a2deb0a3c2e22292f00d496003d27c1d4553f611;hpb=17c42deae16610939d598a0dabe28d2d4d362469;p=flightgear.git diff --git a/src/AIModel/AIFlightPlanCreatePushBack.cxx b/src/AIModel/AIFlightPlanCreatePushBack.cxx index a2deb0a3c..5dc017328 100644 --- a/src/AIModel/AIFlightPlanCreatePushBack.cxx +++ b/src/AIModel/AIFlightPlanCreatePushBack.cxx @@ -17,15 +17,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * **************************************************************************/ + +#ifdef HAVE_CONFIG_H +# include +#endif + #include "AIFlightPlan.hxx" #include #include +#include #include #include -void FGAIFlightPlan::createPushBack(bool firstFlight, FGAirport *dep, +void FGAIFlightPlan::createPushBack(FGAIAircraft *ac, + bool firstFlight, FGAirport *dep, double latitude, double longitude, double radius, @@ -35,9 +42,13 @@ void FGAIFlightPlan::createPushBack(bool firstFlight, FGAirport *dep, { double lat, lon, heading; FGTaxiRoute *pushBackRoute; + // Active runway can be conditionally set by ATC, so at the start of a new flight, this + // must be reset. + activeRunway.clear(); + if (!(dep->getDynamics()->getGroundNetwork()->exists())) { //cerr << "Push Back fallback" << endl; - createPushBackFallBack(firstFlight, dep, latitude, longitude, + createPushBackFallBack(ac, firstFlight, dep, latitude, longitude, radius, fltType, aircraftType, airline); } else { if (firstFlight) { @@ -82,7 +93,7 @@ void FGAIFlightPlan::createPushBack(bool firstFlight, FGAirport *dep, dep->getDynamics()->getParking(gateId, &lat, &lon, &heading); } if (gateId < 0) { - createPushBackFallBack(firstFlight, dep, latitude, longitude, + createPushBackFallBack(ac, firstFlight, dep, latitude, longitude, radius, fltType, aircraftType, airline); return; @@ -140,6 +151,9 @@ void FGAIFlightPlan::createPushBack(bool firstFlight, FGAirport *dep, // some special considerations for the last point: wpt->name = string("PushBackPoint"); wpt->speed = 15; + //for (wpt_vector_iterator i = waypoints.begin(); i != waypoints.end(); i++) { + // cerr << "Waypoint Name: " << (*i)->name << endl; + //} } else { //cerr << "Creating direct forward departure route fragment" << endl; double lat2, lon2, az2; @@ -214,7 +228,7 @@ void FGAIFlightPlan::createPushBack(bool firstFlight, FGAirport *dep, * This is the backup function for airports that don't have a * network yet. ******************************************************************/ -void FGAIFlightPlan::createPushBackFallBack(bool firstFlight, FGAirport *dep, +void FGAIFlightPlan::createPushBackFallBack(FGAIAircraft *ac, bool firstFlight, FGAirport *dep, double latitude, double longitude, double radius,