From c32da90e5c116cc0f68441b69cf773a5499987a1 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 13 Jul 2010 13:47:24 +0100 Subject: [PATCH] Ensure sim/signals/fdm-initialized is only fired on a rising edge; add sim/fdm-initialized as the state value. --- src/Aircraft/replay.cxx | 2 +- src/FDM/fdm_shell.cxx | 4 +++- src/Main/main.cxx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Aircraft/replay.cxx b/src/Aircraft/replay.cxx index d36275e38..aa976adcb 100644 --- a/src/Aircraft/replay.cxx +++ b/src/Aircraft/replay.cxx @@ -163,7 +163,7 @@ void FGReplay::update( double dt ) { //FGProps2NetFDM( &f, false ); // sanity check, don't collect data if FDM data isn't good - if (!fgGetBool("/sim/signals/fdm-initialized", false)) { + if (!fgGetBool("/sim/fdm-initialized", false)) { return; } diff --git a/src/FDM/fdm_shell.cxx b/src/FDM/fdm_shell.cxx index 0d52e5aa3..bec319c09 100644 --- a/src/FDM/fdm_shell.cxx +++ b/src/FDM/fdm_shell.cxx @@ -68,13 +68,14 @@ FDMShell::~FDMShell() void FDMShell::init() { _props = globals->get_props(); + fgSetBool("/sim/fdm-initialized", false); createImplementation(); } void FDMShell::reinit() { if (_impl) { - fgSetBool("/sim/signals/fdm-initialized", false); + fgSetBool("/sim/fdm-initialized", false); evil_global_fdm_state = NULL; _impl->unbind(); delete _impl; @@ -122,6 +123,7 @@ void FDMShell::update(double dt) _impl->bind(); evil_global_fdm_state = _impl; + fgSetBool("/sim/fdm-initialized", true); fgSetBool("/sim/signals/fdm-initialized", true); } } diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 15e677d9a..07c10598a 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -427,7 +427,7 @@ static void fgMainLoop( void ) { // END Tile Manager udpates if (!scenery_loaded && globals->get_tile_mgr()->isSceneryLoaded() - && fgGetBool("sim/signals/fdm-initialized")) { + && fgGetBool("sim/fdm-initialized")) { fgSetBool("sim/sceneryloaded",true); if (fgGetBool("/sim/sound/working")) { globals->get_soundmgr()->activate(); -- 2.39.5