]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIAircraft.cxx
Merge branch 'jmt/font' into next
[flightgear.git] / src / AIModel / AIAircraft.cxx
index 7da692069455eed8f9a836b1db228f29fa1bbf2d..eb8469fdece8dd419a721b5c7262caf3ddc9a6af 100644 (file)
@@ -33,6 +33,7 @@
 #include <string>
 #include <math.h>
 #include <time.h>
+
 #ifdef _MSC_VER
 #  include <float.h>
 #  define finite _finite
@@ -79,11 +80,12 @@ FGAIAircraft::FGAIAircraft(FGAISchedule *ref) : FGAIBase(otAircraft) {
     alt_lock = false;
     roll = 0;
     headingChangeRate = 0.0;
+    headingError = 0;
 
     holdPos = false;
 
     _performance = 0; //TODO initialize to JET_TRANSPORT from PerformanceDB
-    
+    dt = 0;
 }
 
 
@@ -412,7 +414,7 @@ void FGAIAircraft::getGroundElev(double dt) {
         }
 
         double alt;
-        if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(pos, 20000), alt, 0))
+        if (getGroundElevationM(SGGeod::fromGeodM(pos, 20000), alt, 0))
             tgt_altitude_ft = alt * SG_METER_TO_FEET;
     }
 }
@@ -445,15 +447,6 @@ void FGAIAircraft::announcePositionToController() {
         case 4:              //Take off tower controller
             if (trafficRef->getDepartureAirport()->getDynamics()) {
                 controller = trafficRef->getDepartureAirport()->getDynamics()->getTowerController();
-                //if (trafficRef->getDepartureAirport()->getId() == "EHAM") {
-                //string trns = trafficRef->getCallSign() + " at runway " + fp->getRunway() + 
-                //              ". Ready for departure. " + trafficRef->getFlightType() + " to " +
-                //              trafficRef->getArrivalAirport()->getId();
-                //fgSetString("/sim/messages/atc", trns.c_str());
-                //  if (controller == 0) {
-                //cerr << "Error in assigning controller at " << trafficRef->getDepartureAirport()->getId() << endl;
-                //}
-                //}
             } else {
                 cerr << "Error: Could not find Dynamics at airport : " << trafficRef->getDepartureAirport()->getId() << endl;
             }