From 317039cbb269034cb16101c27d5671e5cb5ccf8f Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Wed, 12 Jul 2017 20:45:02 -0400 Subject: [PATCH] A3XX: Fix Man Engine Start System --- Nasal/engines.nas | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Nasal/engines.nas b/Nasal/engines.nas index e08e226c..106add09 100644 --- a/Nasal/engines.nas +++ b/Nasal/engines.nas @@ -77,12 +77,9 @@ setlistener("/controls/engines/engine[0]/man-start", func { var start_one_mancheck = func { if (getprop("/controls/engines/engine[0]/man-start") == 1) { - if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/controls/engines/engine[0]/cutoff-switch") == 1)) { + if (getprop("/controls/engines/engine-start-switch") == 2 and (getprop("/controls/engines/engine[0]/cutoff-switch") == 1)) { setprop("/systems/pneumatic/eng1-starter", 1); - if (getprop("/systems/pneumatic/total-psi") >= 28) { - setprop("/engines/engine[0]/state", 1); - setprop("/controls/engines/engine[0]/starter", 1); - } + settimer(start_one_mancheck_b, 0.5); } } else { if (getprop("/engines/engine[0]/state") == 1 or getprop("/engines/engine[0]/state") == 2) { @@ -93,6 +90,13 @@ var start_one_mancheck = func { } } +var start_one_mancheck_b = func { + if (getprop("/systems/pneumatic/total-psi") >= 28) { + setprop("/engines/engine[0]/state", 1); + setprop("/controls/engines/engine[0]/starter", 1); + } +} + var start_one_check = func { if (getprop("/controls/engines/engine-start-switch") == 2 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { setprop("/systems/pneumatic/eng1-starter", 1); @@ -134,12 +138,9 @@ setlistener("/controls/engines/engine[1]/man-start", func { var start_two_mancheck = func { if (getprop("/controls/engines/engine[1]/man-start") == 1) { - if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/controls/engines/engine[1]/cutoff-switch") == 1)) { + if (getprop("/controls/engines/engine-start-switch") == 2 and (getprop("/controls/engines/engine[1]/cutoff-switch") == 1)) { setprop("/systems/pneumatic/eng2-starter", 1); - if (getprop("/systems/pneumatic/total-psi") >= 28) { - setprop("/engines/engine[1]/state", 1); - setprop("/controls/engines/engine[1]/starter", 1); - } + settimer(start_two_mancheck_b, 0.5); } } else { if (getprop("/engines/engine[1]/state") == 1 or getprop("/engines/engine[1]/state") == 2) { @@ -150,6 +151,13 @@ var start_two_mancheck = func { } } +var start_two_mancheck_b = func { + if (getprop("/systems/pneumatic/total-psi") >= 28) { + setprop("/engines/engine[1]/state", 1); + setprop("/controls/engines/engine[1]/starter", 1); + } +} + var start_two_check = func { if (getprop("/controls/engines/engine-start-switch") == 2 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { setprop("/systems/pneumatic/eng2-starter", 1);