]> git.mxchange.org Git - flightgear.git/commitdiff
Avoid collecting garbage data before the FDM is initialized.
authorcurt <curt>
Fri, 18 Jul 2003 01:51:45 +0000 (01:51 +0000)
committercurt <curt>
Fri, 18 Jul 2003 01:51:45 +0000 (01:51 +0000)
src/Main/main.cxx
src/Replay/replay.cxx

index 3b718ab974e546d60652c20fe8a24e42a235599c..c6dd8cf2641bcc69b8dcbfbfeee084c8e0f81fde 100644 (file)
@@ -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);
index a03827c0bd72495a1c945ad68b06142fc4e319d3..d0dc3f6fa3880697d90301588b184a4e8f5b7583 100644 (file)
@@ -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 );