From: ThorstenB Date: Sun, 8 Jul 2012 09:39:50 +0000 (+0200) Subject: #798: climb rate cannot be higher than the true speed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7edbf8a8c9d41f03d1b974182d585c1112eb7c45;p=flightgear.git #798: climb rate cannot be higher than the true speed Don't set vertical-speed on sim reset, unless the user intentionally requested this as a start-up property. --- diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index b4027b14b..5fd06bad9 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -63,7 +63,7 @@ int FGInterface::_calc_multiloop (double dt) { // Since some time the simulation time increments we get here are - // already a multiple of the basic update freqency. + // already a multiple of the basic update frequency. // So, there is no need to do our own multiloop rounding with all bad // roundoff problems when we already have nearly accurate values. // Only the speedup thing must be still handled here @@ -158,6 +158,8 @@ FGInterface::common_init () double ground_elev_m = get_groundlevel_m(lat, lon, alt_m); double ground_elev_ft = ground_elev_m * SG_METER_TO_FEET; _set_Runway_altitude ( ground_elev_ft ); + + // Set aircraft altitude if ( fgGetBool("/sim/presets/onground") || alt_ft < ground_elev_ft ) { fgSetDouble("/position/altitude-ft", ground_elev_ft + 0.1); set_Altitude( ground_elev_ft + 0.1); @@ -218,8 +220,11 @@ FGInterface::common_init () if ( fgHasNode("/sim/presets/glideslope-deg") ) set_Gamma_vert_rad( fgGetDouble("/sim/presets/glideslope-deg") * SGD_DEGREES_TO_RADIANS ); - else if ( fgHasNode( "/velocities/vertical-speed-fps") ) - set_Climb_Rate( fgGetDouble("/velocities/vertical-speed-fps") ); + else if ( fgHasNode("/sim/presets/speed-set") && + fgHasNode( "/sim/presets/vertical-speed-fps") ) + { + set_Climb_Rate( fgGetDouble("/sim/presets/vertical-speed-fps") ); + } SG_LOG( SG_FLIGHT, SG_INFO, "End common FDM init" ); } diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 24eb4f38e..4cf4dd638 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -733,7 +733,7 @@ fgOptMach( const char *arg ) static int fgOptRoc( const char *arg ) { - fgSetDouble("/velocities/vertical-speed-fps", atof(arg)/60); + fgSetDouble("/sim/presets/vertical-speed-fps", atof(arg)/60); return FG_OPTIONS_OK; }