1
0
Fork 0

Add contraints

This commit is contained in:
Matthew Maring 2020-05-31 14:39:33 -04:00
parent 3c8402dbbc
commit efc771c89e

View file

@ -147,6 +147,10 @@ var windCLBPage = {
if (size(me.windList) >= index) {
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) == 13) {
var winds = split("/", mcdu_scratchpad.scratchpads[me.computer].scratchpad);
if (size(winds[0]) == 3 and num(winds[0]) != nil and winds[0] >= 0 and winds[0] <= 360 and
size(winds[1]) == 3 and num(winds[1]) != nil and winds[1] >= 0 and winds[1] <= 200 and
size(winds[2]) == 5 and ((num(winds[2]) != nil and winds[2] >= 1000 and winds[2] <= 39000) or
(num(split("FL", winds[2])[1]) != nil and split("FL", winds[2])[1] >= 10 and split("FL", winds[2])[1] <= 390))) {
me.windList[index - 1] = [winds[0], winds[1], winds[2]];
mcdu_scratchpad.scratchpads[me.computer].empty();
if (index != 5) {
@ -161,5 +165,8 @@ var windCLBPage = {
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
}
};