Avoid collecting garbage data before the FDM is initialized.
This commit is contained in:
parent
a3b28d16af
commit
75861ec95d
2 changed files with 9 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue