]> git.mxchange.org Git - flightgear.git/commitdiff
Mathias:
authorehofman <ehofman>
Wed, 27 Jul 2005 11:53:47 +0000 (11:53 +0000)
committerehofman <ehofman>
Wed, 27 Jul 2005 11:53:47 +0000 (11:53 +0000)
Turns out to be a bad interaction between jsbsims crash detection and my
past initialization changes.
The attached patch fixes this by moving crash detection out of the
initialization phase of jsbsim.

src/FDM/JSBSim/JSBSim.cxx

index 53be9685a91eeab7c89c6af6a38aa5629f5e4071..40650a6eafa67edadac64c8da041a7e73be25b5e 100644 (file)
@@ -487,6 +487,12 @@ void FGJSBsim::update( double dt )
     // translate JSBsim back to FG structure so that the
     // autopilot (and the rest of the sim can use the updated values
     copy_from_JSBsim();
+
+    // crashed (altitude AGL < 0)
+    if (get_Altitude_AGL() < 0.0) {
+      crash_message = "Attempted to fly under ground.";
+      crash_handler();
+    }
 }
 
 /******************************************************************************/
@@ -817,12 +823,6 @@ bool FGJSBsim::copy_from_JSBsim()
     speedbrake_pos_pct->setDoubleValue( FCS->GetDsbPos(ofNorm) );
     spoilers_pos_pct->setDoubleValue( FCS->GetDspPos(ofNorm) );
 
-    // crashed (altitude AGL < 0)
-    if (get_Altitude_AGL() < 0.0) {
-      crash_message = "Attempted to fly under ground.";
-      crash_handler();
-    }
-
     return true;
 }