]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIAircraft.cxx
fix a pointer reference.
[flightgear.git] / src / AIModel / AIAircraft.cxx
index 4bc5cc3c0de57bcad1fcee3ca09a628ad12c5bab..3f7b476d4e52b844f1409fa253a4950a57f2ae93 100644 (file)
@@ -79,11 +79,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;
 }
 
 
@@ -277,8 +278,8 @@ void FGAIAircraft::ProcessFlightPlan( double dt, time_t now ) {
         }
 
         //TODO let the fp handle this (loading of next leg)
-        fp->IncrementWaypoint((bool) trafficRef);
-        if (!(fp->getNextWaypoint()) && trafficRef)
+        fp->IncrementWaypoint( trafficRef != 0 );
+        if (!(fp->getNextWaypoint()) && trafficRef != 0)
             if (!loadNextLeg()) {
                 setDie(true);
                 return;
@@ -412,7 +413,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;
     }
 }