diff --git a/Nasal/pneumatics.nas b/Nasal/pneumatics.nas index f67137d5..4663b43d 100644 --- a/Nasal/pneumatics.nas +++ b/Nasal/pneumatics.nas @@ -415,36 +415,36 @@ var flashfault2 = func { setprop("/controls/deice/eng2-fault", 0); }, 0.5); } - # Oxygen (Cabin) - setlistener("/controls/oxygen/masksDeployMan", func { - if (guard and masks) { - setprop("/controls/oxygen/masksDeployMan", 0); - } else if (!guard and masks) { - setprop("/controls/oxygen/masksDeployMan", 1); - setprop("/controls/oxygen/masksDeploy", 1); - setprop("/controls/oxygen/masksSys", 1); - } - }); +# Oxygen (Cabin) - if (cabinalt > 13500) { +setlistener("/controls/oxygen/masksDeployMan", func { + if (guard and masks) { + setprop("/controls/oxygen/masksDeployMan", 0); + } else if (!guard and masks) { + setprop("/controls/oxygen/masksDeployMan", 1); setprop("/controls/oxygen/masksDeploy", 1); setprop("/controls/oxygen/masksSys", 1); } - - setlistener("/controls/oxygen/masksDeployMan", func { - var masks = getprop("/controls/oxygen/masksDeployMan"); - var autoMasks = getprop("/controls/oxygen/masksDeploy"); - if (!masks) { - setprop("/controls/oxygen/masksDeployMan", 1); - } - }); +}); - setlistener("/controls/oxygen/masksDeploy", func { - var masks = getprop("/controls/oxygen/masksDeployMan"); - var autoMasks = getprop("/controls/oxygen/masksDeploy"); - if (!autoMasks) { - setprop("/controls/oxygen/masksDeploy", 1); - } - }); +if (cabinalt > 13500) { + setprop("/controls/oxygen/masksDeploy", 1); + setprop("/controls/oxygen/masksSys", 1); } + +setlistener("/controls/oxygen/masksDeployMan", func { + var masks = getprop("/controls/oxygen/masksDeployMan"); + var autoMasks = getprop("/controls/oxygen/masksDeploy"); + if (!masks) { + setprop("/controls/oxygen/masksDeployMan", 1); + } +}); + +setlistener("/controls/oxygen/masksDeploy", func { + var masks = getprop("/controls/oxygen/masksDeployMan"); + var autoMasks = getprop("/controls/oxygen/masksDeploy"); + if (!autoMasks) { + setprop("/controls/oxygen/masksDeploy", 1); + } +});