From 0490631250e7053ee317f7f29fc70def0328040e Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 5 Apr 2004 16:47:13 +0000 Subject: [PATCH] Jim Wilson: This update contains a change to not overwrite the altitude-ft preset during "onground" start. The change also prevents a ground trim issue with the JSBSim fdm when a "reset" is done by FlightGear. --- src/FDM/flight.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index 93125bba3..b0969c3f6 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -196,10 +196,11 @@ FGInterface::common_init () _set_Runway_altitude ( ground_elev_ft ); if ( fgGetBool("/sim/presets/onground") || fgGetDouble("/sim/presets/altitude-ft") < ground_elev_ft ) { - fgSetDouble("/sim/presets/altitude-ft", ground_elev_ft); fgSetDouble("/position/altitude-ft", ground_elev_ft); + set_Altitude( ground_elev_ft ); + } else { + set_Altitude( fgGetDouble("/sim/presets/altitude-ft") ); } - set_Altitude( fgGetDouble("/sim/presets/altitude-ft") ); // Set ground elevation SG_LOG( SG_FLIGHT, SG_INFO, @@ -210,12 +211,12 @@ FGInterface::common_init () SG_LOG( SG_FLIGHT, SG_INFO, "...initializing sea-level radius..." ); SG_LOG( SG_FLIGHT, SG_INFO, " lat = " << fgGetDouble("/sim/presets/latitude-deg") - << " alt = " << fgGetDouble("/sim/presets/altitude-ft") ); + << " alt = " << get_Altitude() ); double sea_level_radius_meters; double lat_geoc; sgGeodToGeoc( fgGetDouble("/sim/presets/latitude-deg") * SGD_DEGREES_TO_RADIANS, - fgGetDouble("/sim/presets/altitude-ft") * SG_FEET_TO_METER, + get_Altitude() * SG_FEET_TO_METER, &sea_level_radius_meters, &lat_geoc ); _set_Sea_level_radius( sea_level_radius_meters * SG_METER_TO_FEET );