From: curt Date: Fri, 18 Jul 2003 01:51:45 +0000 (+0000) Subject: Avoid collecting garbage data before the FDM is initialized. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=75861ec95dbb6c378472186359f72811436d60f5;p=flightgear.git Avoid collecting garbage data before the FDM is initialized. --- diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 3b718ab97..c6dd8cf26 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -964,9 +964,7 @@ void fgUpdateTimeDepCalcs() { // conceptually, the following block could be done for each fdm // instance ... - if ( !cur_fdm_state->get_inited() ) { - // do nothing, fdm isn't inited yet - } else { + if ( cur_fdm_state->get_inited() ) { // we have been inited, and we are good to go ... if ( !inited ) { @@ -982,6 +980,8 @@ void fgUpdateTimeDepCalcs() { replay_time->setDoubleValue( replay_time->getDoubleValue() + replay_dt_sec ); } + } else { + // do nothing, fdm isn't inited yet } globals->get_model_mgr()->update(delta_time_sec); diff --git a/src/Replay/replay.cxx b/src/Replay/replay.cxx index a03827c0b..d0dc3f6fa 100644 --- a/src/Replay/replay.cxx +++ b/src/Replay/replay.cxx @@ -23,6 +23,7 @@ #include +#include #include #include #include @@ -106,6 +107,11 @@ void FGReplay::update( double dt ) { FGNetFDM f; FGProps2NetFDM( &f, false ); + // sanity check, don't collect data if FDM data isn't good + if ( !cur_fdm_state->get_inited() ) { + return; + } + FGNetCtrls c; FGProps2NetCtrls( &c, false, false );