1
0
Fork 0

Clouds in scenario none and metar were above 0ft not above ground elevation, which lead to clouds at or below ground level for high altitude airfields. Reason: For the scenario none, the station_elevation was computed before the terrain was loaded, for METAR scenario station_elevation was not computed at all.

This commit is contained in:
torsten 2009-05-22 18:19:25 +00:00 committed by Tim Moore
parent 685132b5d2
commit cef9eb3d73
2 changed files with 16 additions and 0 deletions

View file

@ -266,11 +266,25 @@ FGEnvironmentMgr::unbind ()
fgUntie("/environment/turbulence/use-cloud-turbulence");
}
/* probably this should be a class member? */
static bool scenery_loaded = false;
void
FGEnvironmentMgr::update (double dt)
{
SGSubsystemGroup::update(dt);
{
/*
re set the scenario after the scenery has been loaded
(raising edge of sim/sceneryloaded)
so that ground elevation can be computed.
*/
bool b = fgGetBool( "sim/sceneryloaded" );
if( !scenery_loaded && b )
fgClouds->set_scenario( fgClouds->get_scenario() );
scenery_loaded = b;
}
// FIXME: the FDMs should update themselves
current_aircraft.fdm_state
->set_Velocities_Local_Airmass(_environment->get_wind_from_north_fps(),

View file

@ -493,6 +493,8 @@ void FGClouds::set_scenario(const char * sc) {
}
if( scenario == "METAR" ) {
// needed here to compute station_elevation_ft
buildScenario( scenario );
string realMetar = fgGetString("/environment/metar/real-metar", "");
if( realMetar != "" ) {