If preset-commit occurs during init, skip most re-init logic.
This commit is contained in:
parent
eeaf4b13e6
commit
c053de6b4c
2 changed files with 11 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue