From: Erik Hofman Date: Thu, 2 Apr 2015 18:31:17 +0000 (+0200) Subject: Do not run the HoldDown code until after the aircraft is trimmed to prevent a devide... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e10b4934212bd25c7f6a17fb9078a44cedfbff8d;p=flightgear.git Do not run the HoldDown code until after the aircraft is trimmed to prevent a devide by zero and ultimately a segmentation fault --- diff --git a/src/FDM/JSBSim/models/FGAccelerations.cpp b/src/FDM/JSBSim/models/FGAccelerations.cpp index cdb01fcec..0638eb97d 100644 --- a/src/FDM/JSBSim/models/FGAccelerations.cpp +++ b/src/FDM/JSBSim/models/FGAccelerations.cpp @@ -157,7 +157,7 @@ void FGAccelerations::CalculatePQRdot(void) // Compute body frame rotational accelerations based on the current body // moments and the total inertial angular velocity expressed in the body // frame. - if (HoldDown) { + if (HoldDown && !FDMExec->GetTrimStatus()) { // The rotational acceleration in ECI is calculated so that the rotational // acceleration is zero in the body frame. vPQRdot.InitMatrix(); @@ -201,7 +201,7 @@ void FGAccelerations::CalculateQuatdot(void) void FGAccelerations::CalculateUVWdot(void) { - if (HoldDown) + if (HoldDown && !FDMExec->GetTrimStatus()) vBodyAccel.InitMatrix(); else vBodyAccel = in.Force / in.Mass;