]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a preset in the air problem.
authorcurt <curt>
Sat, 10 May 2003 13:33:04 +0000 (13:33 +0000)
committercurt <curt>
Sat, 10 May 2003 13:33:04 +0000 (13:33 +0000)
src/Main/fg_init.cxx

index 856977bd2f7d50c469276f5a4e48fd6aeba5424f..847fcf9d5f896745deba526bcc6fcbee98064610 100644 (file)
@@ -981,9 +981,13 @@ fgInitNav ()
 bool fgInitPosition() {
     bool set_pos = false;
 
-    // Default to starting on the ground unless one of the other
-    // conditions implies an in-air start.
-    fgSetBool("/sim/presets/onground", true);
+    // Do a first guess if we should be on the ground or in the air
+    // (to be refined later based on other input.
+    if ( fgGetDouble("/sim/presets/altitude-ft") > -9990.0 ) {
+        fgSetBool("/sim/presets/onground", false);
+    } else {
+        fgSetBool("/sim/presets/onground", true);
+    }
 
     // If glideslope is specified, then calculate offset-distance or
     // altitude relative to glide slope if either of those was not