1
0
Fork 0

Do not run the HoldDown code until after the aircraft is trimmed to prevent a devide by zero and ultimately a segmentation fault

This commit is contained in:
Erik Hofman 2015-04-02 20:31:17 +02:00
parent aa63e65122
commit e10b493421

View file

@ -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;