]> git.mxchange.org Git - flightgear.git/commitdiff
Ron Jensen:
authortorsten <torsten>
Sun, 20 Sep 2009 15:42:46 +0000 (15:42 +0000)
committerTim Moore <timoore@redhat.com>
Sun, 20 Sep 2009 20:51:36 +0000 (22:51 +0200)
While troubleshooting the new environment I discovered the metar station
elevation (station_elevation_ft) is never being set because there is a
local variable that overrides it.

src/Environment/environment_ctrl.cxx
src/Environment/environment_ctrl.hxx

index 008729be6ec0cdd7436ef098813cfdd56354cdf9..5b9cfcfb99744b5e0a72843dbb252f57ab1518d8 100644 (file)
@@ -268,7 +268,6 @@ FGMetarCtrl::FGMetarCtrl( SGSubsystem * environmentCtrl )
        metar_valid(false),
        setup_winds_aloft(true),
        wind_interpolation_required(true),
-       station_elevation_ft(0.0),
        // Interpolation constant definitions.
        EnvironmentUpdatePeriodSec( 0.2 ),
        MaxWindChangeKtsSec( 0.2 ),
@@ -667,9 +666,11 @@ FGMetarCtrl::update(double dt)
                        }
                }
        }
-
-       set_temp_at_altitude(temperature_n->getDoubleValue(), station_elevation_ft);
-       set_dewpoint_at_altitude(dewpoint_n->getDoubleValue(), station_elevation_ft);
+       {
+               double station_elevation_ft = station_elevation_n->getDoubleValue();
+               set_temp_at_altitude(temperature_n->getDoubleValue(), station_elevation_ft);
+               set_dewpoint_at_altitude(dewpoint_n->getDoubleValue(), station_elevation_ft);
+       }
        //TODO: check if temperature/dewpoint have changed. This requires reinit.
 
        // Force an update of the 3D clouds
index f5a5024cc80f0c35937c5490fd4eaad266c06c97..76b6aab20e0f1820aa21f54a6d2c8a710e0f10df 100644 (file)
@@ -150,7 +150,6 @@ private:
        bool setup_winds_aloft;
        bool first_update;
        bool wind_interpolation_required;
-       double station_elevation_ft;
        string metar;
        double interpolate_prop(const char * currentname, const char * requiredname, double dvalue);
        double interpolate_val(double currentval, double requiredval, double dvalue);