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 <simgear/constants.h> +#include <FDM/flight.hxx> #include <Network/native_ctrls.hxx> #include <Network/native_fdm.hxx> #include <Network/net_ctrls.hxx> @@ -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 );