X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FEnvironment%2Fenvironment_ctrl.cxx;h=5b9cfcfb99744b5e0a72843dbb252f57ab1518d8;hb=11d15b451347674fba77648700d23c5aaec3c6c2;hp=008729be6ec0cdd7436ef098813cfdd56354cdf9;hpb=4d977e941155b484a047f766e1eaff716ae7dcca;p=flightgear.git diff --git a/src/Environment/environment_ctrl.cxx b/src/Environment/environment_ctrl.cxx index 008729be6..5b9cfcfb9 100644 --- a/src/Environment/environment_ctrl.cxx +++ b/src/Environment/environment_ctrl.cxx @@ -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