]> git.mxchange.org Git - flightgear.git/commitdiff
If preset-commit occurs during init, skip most re-init logic.
authorJames Turner <zakalawe@mac.com>
Tue, 2 Nov 2010 23:19:09 +0000 (23:19 +0000)
committerJames Turner <zakalawe@mac.com>
Tue, 2 Nov 2010 23:19:09 +0000 (23:19 +0000)
src/Main/fg_commands.cxx
src/Main/fg_init.cxx

index 46c6851b376bf458e1120ed9503bba5b47199a6f..e3b6be0c0f3817374ad1bdbd59a2f1816d82d893 100644 (file)
@@ -1211,7 +1211,15 @@ do_play_audio_sample (const SGPropertyNode * arg)
 static bool
 do_presets_commit (const SGPropertyNode * arg)
 {
-    fgReInitSubsystems();
+    if (fgGetBool("/sim/initialized", false)) {
+      fgReInitSubsystems();
+    } else {
+      // Nasal can trigger this during initial init, which confuses
+      // the logic in ReInitSubsystems, since initial state has not been
+      // saved at that time. Short-circuit everything here.
+      fgInitPosition();
+    }
+    
     return true;
 }
 
index 024e6e2f754fffc87874024472510cc2876c09b6..65be585e420f1d896548177fe2c1235bc10e6803 100644 (file)
@@ -1491,6 +1491,8 @@ bool fgInitSubsystems() {
     // End of subsystem initialization.
     ////////////////////////////////////////////////////////////////////
 
+    fgSetBool("/sim/initialized", true);
+
     SG_LOG( SG_GENERAL, SG_INFO, endl);
 
                                 // Save the initial state for future