]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/newauto.cxx
Default to glider again when model is not present.
[flightgear.git] / src / Autopilot / newauto.cxx
index 8d13af2a97bb83951dee44558dac60d1a3c29874..ccbf01cb4ee324aac7f00ffa40f929f7f4806cd8 100644 (file)
@@ -256,6 +256,7 @@ void FGAutopilot::init ()
     altitude_hold = false ;     // turn the altitude hold off
     auto_throttle = false ;    // turn the auto throttle off
     heading_mode = DEFAULT_AP_HEADING_LOCK;
+    altitude_mode = DEFAULT_AP_ALTITUDE_LOCK;
 
     DGTargetHeading = fgGetDouble("/autopilot/settings/heading-bug-deg");
     TargetHeading = fgGetDouble("/autopilot/settings/heading-bug-deg");
@@ -420,7 +421,7 @@ static double LinearExtrapolate( double x, double x1, double y1, double x2, doub
 
 
 void
-FGAutopilot::update (int dt)
+FGAutopilot::update (double dt)
 {
     // Remove the following lines when the calling funcitons start
     // passing in the data pointer
@@ -939,8 +940,8 @@ void FGAutopilot::AltitudeSet( double new_altitude ) {
        target_alt = new_altitude * SG_FEET_TO_METER;
     }
 
-    if( target_alt < scenery.get_cur_elev() ) {
-       target_alt = scenery.get_cur_elev();
+    if( target_alt < globals->get_scenery()->get_cur_elev() ) {
+       target_alt = globals->get_scenery()->get_cur_elev();
     }
 
     TargetAltitude = target_alt;