]> git.mxchange.org Git - flightgear.git/commitdiff
Modified the loop so that the simulation is suspended whenever the user
authorBertrand Coconnier <bcoconni@users.sourceforge.net>
Sun, 12 Apr 2015 16:20:00 +0000 (18:20 +0200)
committerBertrand Coconnier <bcoconni@users.sourceforge.net>
Sun, 12 Apr 2015 16:20:00 +0000 (18:20 +0200)
set the property fdm/jsbsim/simulation/terminate to true.

src/FDM/JSBSim/JSBSim.cxx

index c4e56d96422a210177c80d25ca9da0cbf9240b6d..dbce5df7223642b4a9efd2c15430396920321aa4 100644 (file)
@@ -523,7 +523,12 @@ void FGJSBsim::update( double dt )
     trimmed->setBoolValue(false);
 
     for ( int i=0; i < multiloop; i++ ) {
-      fdmex->Run();
+      if (!fdmex->Run()) {
+        // The property fdm/jsbsim/simulation/terminate has been set to true
+        // by the user. The sim is considered crashed.
+        crashed = true;
+        break;
+      }
       update_external_forces(fdmex->GetSimTime() + i * fdmex->GetDeltaT());
     }