]> git.mxchange.org Git - flightgear.git/commitdiff
ADF needle doesn't zero when it goes out of range.
authorcurt <curt>
Wed, 14 Mar 2001 14:35:27 +0000 (14:35 +0000)
committercurt <curt>
Wed, 14 Mar 2001 14:35:27 +0000 (14:35 +0000)
src/Cockpit/steam.cxx

index af1a588963e9c906d932b1dafd43b235ded34953..00e82c1c52cf5168fe9f7f4fe83d503c243c040e 100644 (file)
@@ -200,7 +200,7 @@ void FGSteam::_CatchUp()
   {    double dt = _UpdatesPending * 1.0 / 
            fgGetInt("/sim/model-hz"); // FIXME: inefficient
         double AccN, AccE, AccU;
-       int i /*,j*/;
+       /* int i, j; */
        double d, the_ENGINE_rpm;
 
 #if 0
@@ -484,18 +484,18 @@ double FGSteam::get_HackOBS2_deg () {
 
 
 double FGSteam::get_HackADF_deg () {
+    static double last_r = 0;
     double r;
 
     if ( current_radiostack->get_adf_inrange() ) {
-       r = current_radiostack->get_adf_heading() - FGBFI::getHeading();
-
+       double r = current_radiostack->get_adf_heading() - FGBFI::getHeading();
+       last_r = r;
        // cout << "Radial = " << current_radiostack->get_adf_heading() 
        //      << "  Heading = " << FGBFI::getHeading() << endl;
+       return r;
     } else {
-       r = 0.0;
+       return last_r;
     }
-
-    return r;
 }