diff --git a/Nasal/MCDU/WINDCLB.nas b/Nasal/MCDU/WINDCLB.nas index 9e1bed20..c40782c1 100644 --- a/Nasal/MCDU/WINDCLB.nas +++ b/Nasal/MCDU/WINDCLB.nas @@ -147,14 +147,21 @@ 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); - me.windList[index - 1] = [winds[0], winds[1], winds[2]]; - mcdu_scratchpad.scratchpads[me.computer].empty(); - if (index != 5) { - append(me.windList, nil); + 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) { + append(me.windList, nil); + } + me._setupPageWithData(); + me.makeTmpy(); + me.updateTmpy(); + } else { + mcdu_message(me.computer, "NOT ALLOWED"); } - me._setupPageWithData(); - me.makeTmpy(); - me.updateTmpy(); } else { mcdu_message(me.computer, "NOT ALLOWED"); }