diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 070d4daf3..394e28d87 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -941,9 +941,7 @@ void fgStartNewReset() { SGPropertyNode_ptr preserved(new SGPropertyNode); - // copy properties which are USERARCHIVEd or PRESERVEd - int checked = SGPropertyNode::USERARCHIVE+SGPropertyNode::PRESERVE; - if (!copyProperties(globals->get_props(), preserved, checked, checked)) + if (!copyPropertiesWithAttribute(globals->get_props(), preserved, SGPropertyNode::PRESERVE)) SG_LOG(SG_GENERAL, SG_ALERT, "Error saving preserved state"); fgSetBool("/sim/signals/reinit", true); @@ -953,7 +951,7 @@ void fgStartNewReset() subsystemManger->shutdown(); subsystemManger->unbind(); - // remove them all (with some exceptions?) + // remove most subsystems, with a few exceptions. for (int g=0; gget_group(static_cast(g)); const string_list& names(grp->member_names()); @@ -1002,12 +1000,13 @@ void fgStartNewReset() simgear::clearEffectCache(); simgear::SGModelLib::resetPropertyRoot(); - globals->resetPropertyRoot(); + simgear::GlobalParticleCallback::setSwitch(NULL); + globals->resetPropertyRoot(); fgInitConfig(0, NULL, true); fgInitGeneral(); // all of this? - if ( copyProperties(preserved, globals->get_props(), checked, checked)) { + if ( copyProperties(preserved, globals->get_props()) ) { SG_LOG( SG_GENERAL, SG_INFO, "Preserved state restored successfully" ); } else { SG_LOG( SG_GENERAL, SG_INFO, diff --git a/src/Main/options.cxx b/src/Main/options.cxx index e3e66c0dd..44d5d7c5f 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1928,6 +1928,10 @@ void Options::initAircraft() SG_LOG(SG_INPUT, SG_INFO, "No user specified aircraft, using default" ); } +// persist across reset + SGPropertyNode* aircraftProp = fgGetNode("/sim/aircraft", true); + aircraftProp->setAttribute(SGPropertyNode::PRESERVE, true); + if (p->showAircraft) { fgOptLogLevel( "alert" ); SGPath path( globals->get_fg_root() );