From 4bd2314430cfe9517b1b7beac24e287efef70874 Mon Sep 17 00:00:00 2001 From: ehofman Date: Wed, 27 Jul 2005 11:53:47 +0000 Subject: [PATCH] Mathias: 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/FDM/JSBSim/JSBSim.cxx b/src/FDM/JSBSim/JSBSim.cxx index 53be9685a..40650a6ea 100644 --- a/src/FDM/JSBSim/JSBSim.cxx +++ b/src/FDM/JSBSim/JSBSim.cxx @@ -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; } -- 2.39.5