]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIFlightPlanCreatePushBack.cxx
Merge branch 'next' into durk-atc
[flightgear.git] / src / AIModel / AIFlightPlanCreatePushBack.cxx
index 4ef5f573b7daf516d5ebbf5086c4f2222cd39582..191423ff901b925d200323d11bf8c4f4b9e9f4ed 100644 (file)
@@ -23,6 +23,8 @@
 #endif
 
 #include <simgear/math/sg_geodesy.hxx>
+
+#include <Airports/simple.hxx>
 #include <Airports/runways.hxx>
 #include <Airports/dynamics.hxx>
 
@@ -35,7 +37,7 @@
 
 
 // TODO: Use James Turner's createOnGround functions.
-void FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
+bool FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
                                     bool firstFlight, FGAirport *dep, 
                                    double latitude,
                                    double longitude,
@@ -69,6 +71,7 @@ void FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
                                               " of flight type " << fltType << 
                                               " of airline     " << airline <<
                                               " at airport     " << dep->getId());
+                    return false;
                     char buffer[10];
                     snprintf (buffer, 10, "%d", gateId);
                     //FGTaxiNode *tn = dep->getDynamics()->getGroundNetwork()->findNode(node);
@@ -102,7 +105,7 @@ void FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
         if (gateId < 0) {
              createPushBackFallBack(ac, firstFlight, dep, latitude, longitude,
                                     radius, fltType, aircraftType, airline);
-             return;
+             return true;
 
         }
        //cerr << "getting parking " << gateId;
@@ -163,7 +166,7 @@ void FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
               //}
         } else {
            //cerr << "Creating direct forward departure route fragment" << endl;
-           double lat2, lon2, az2;
+           double lat2 = 0.0, lon2 = 0.0, az2 = 0.0;
            waypoint *wpt;
            geo_direct_wgs_84 ( 0, lat, lon, heading, 
                                2, &lat2, &lon2, &az2 );
@@ -229,6 +232,7 @@ void FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
         }
 
     }
+    return true;
 }
 /*******************************************************************
  * createPushBackFallBack
@@ -246,9 +250,9 @@ void FGAIFlightPlan::createPushBackFallBack(FGAIAircraft *ac, bool firstFlight,
   double heading;
   double lat;
   double lon;
-  double lat2;
-  double lon2;
-  double az2;
+  double lat2 = 0.0;
+  double lon2 = 0.0;
+  double az2 = 0.0;
 
   double vTaxi = ac->getPerformance()->vTaxi();
   double vTaxiBackward = vTaxi * (-2.0/3.0);