From ac599a231959d9b914da886080fdbf3487486612 Mon Sep 17 00:00:00 2001 From: fly Date: Fri, 30 Apr 2021 12:32:41 +0000 Subject: [PATCH] Fix APDisc warning being cancled instantly Signed-off-by: fly --- Nasal/FMGC/FCU.nas | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index 304484ca..37720dfa 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -159,13 +159,15 @@ var FCUController = { if (ap1.getBoolValue() or ap2.getBoolValue()) { apOff("soft", 0); } else if (getprop("/it-autoflight/sound/apoffsound") == 1 or getprop("/it-autoflight/sound/apoffsound2") == 1 or getprop("/it-autoflight/output/ap-warning") != 0) { - if (getprop("/it-autoflight/sound/apoffsound") == 1 or getprop("/it-autoflight/sound/apoffsound2") == 1) { - setprop("/it-autoflight/sound/apoffsound", 0); - setprop("/it-autoflight/sound/apoffsound2", 0); - } - if (getprop("/it-autoflight/output/ap-warning") != 0) { - setprop("/it-autoflight/output/ap-warning", 0); - ecam.lights[0].setValue(0); + if (press == 1) { + if (getprop("/it-autoflight/sound/apoffsound") == 1 or getprop("/it-autoflight/sound/apoffsound2") == 1) { + setprop("/it-autoflight/sound/apoffsound", 0); + setprop("/it-autoflight/sound/apoffsound2", 0); + } + if (getprop("/it-autoflight/output/ap-warning") != 0) { + setprop("/it-autoflight/output/ap-warning", 0); + ecam.lights[0].setValue(0); + } } } else if (side != 0) { if (press == 1) {