From 38094fce3a27355d2c12acfe2828273a94ff45aa Mon Sep 17 00:00:00 2001 From: Josh Davidson Date: Mon, 26 Sep 2022 16:19:35 -0400 Subject: [PATCH] FMGC: Fix managed speed refusing to accelerate to 250 --- Nasal/FMGC/FMGC.nas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 84d6ba8d..87895b81 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -991,7 +991,12 @@ var ManagedSPD = maketimer(0.25, func { } } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > (FMGCInternal.clbSpdLimAlt + 20)) { FMGCInternal.mngKtsMach = FMGCInternal.machSwitchover ? 1 : 0; - FMGCInternal.mngSpdCmd = FMGCInternal.machSwitchover ? math.min(mng_alt_mach, ktsToMach(constraintSpeed)) : math.min(mng_alt_spd, constraintSpeed); + + if (constraintSpeed != nil and constraintSpeed != 0) { + FMGCInternal.mngSpdCmd = FMGCInternal.machSwitchover ? math.min(mng_alt_mach, ktsToMach(constraintSpeed)) : math.min(mng_alt_spd, constraintSpeed); + } else { + FMGCInternal.mngSpdCmd = FMGCInternal.machSwitchover ? mng_alt_mach : mng_alt_spd; + } } elsif ((FMGCInternal.phase >= 4 and FMGCInternal.phase <= 6) and altitude > (FMGCInternal.desSpdLimAlt + 20)) { if (FMGCInternal.decel) { FMGCInternal.mngKtsMach = 0;