1
0
Fork 0

If preset-commit occurs during init, skip most re-init logic.

This commit is contained in:
James Turner 2010-11-02 23:19:09 +00:00
parent eeaf4b13e6
commit c053de6b4c
2 changed files with 11 additions and 1 deletions

View file

@ -1211,7 +1211,15 @@ do_play_audio_sample (const SGPropertyNode * arg)
static bool static bool
do_presets_commit (const SGPropertyNode * arg) 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; return true;
} }

View file

@ -1491,6 +1491,8 @@ bool fgInitSubsystems() {
// End of subsystem initialization. // End of subsystem initialization.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
fgSetBool("/sim/initialized", true);
SG_LOG( SG_GENERAL, SG_INFO, endl); SG_LOG( SG_GENERAL, SG_INFO, endl);
// Save the initial state for future // Save the initial state for future