diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index cc8ad6732..ff8c057ec 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -970,6 +970,10 @@ static struct { void fgInitCommands () { + // set our property root as the implicit default root for the + // command managr + SGCommandMgr::instance()->setImplicitRoot(globals->get_props()); + SG_LOG(SG_GENERAL, SG_BULK, "Initializing basic built-in commands:"); for (int i = 0; built_ins[i].name != 0; i++) { SG_LOG(SG_GENERAL, SG_BULK, " " << built_ins[i].name); diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index b60739c0f..9d1d65dda 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -1194,6 +1194,9 @@ void fgStartNewReset() fgInitConfig(0, NULL, true); fgInitGeneral(); // all of this? + // set out new property root on the command manager + SGCommandMgr::instance()->setImplicitRoot(globals->get_props()); + flightgear::Options::sharedInstance()->processOptions(); // Rebuild the lists of allowed paths for cases where a path comes from an diff --git a/src/Main/main.cxx b/src/Main/main.cxx index f98dc4c36..b0a0dbcd0 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -55,6 +55,7 @@ extern bool global_crashRptEnabled; #include #include #include +#include #include #include
@@ -122,6 +123,8 @@ static void fgMainLoop( void ) // update all subsystems globals->get_subsystem_mgr()->update(sim_dt); + // flush commands waiting in the queue + SGCommandMgr::instance()->executedQueuedCommands(); simgear::AtomicChangeListener::fireChangeListeners(); } @@ -290,7 +293,7 @@ static void fgIdleFunction ( void ) { // Initialize the property-based built-in commands //////////////////////////////////////////////////////////////////// fgInitCommands(); - fgInitSceneCommands(); + fgInitSceneCommands(); flightgear::registerSubsystemCommands(globals->get_commands());