From d67ff09a79b804d66cf009fb3abece0cfd438a13 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Wed, 26 Jan 2022 12:56:15 +0000 Subject: [PATCH] HOLD fix --- Nasal/MCDU/F-PLN.nas | 4 ++-- Nasal/MCDU/HOLD.nas | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Nasal/MCDU/F-PLN.nas b/Nasal/MCDU/F-PLN.nas index f22fff2c..80b79ed3 100644 --- a/Nasal/MCDU/F-PLN.nas +++ b/Nasal/MCDU/F-PLN.nas @@ -29,8 +29,8 @@ var fplnItem = { if (wptName[0] == "VECTORS") { return ["MANUAL", me.getSubText(), me.colour]; } else { - if (me.wp.fly_type == "HOLD") { - return ["HOLD " ~ me.wp.hold_is_left_handed ? "L" : "R", me.getSubText(), me.colour]; + if (me.wp.fly_type == "Hold") { + return ["HOLD " ~ (me.wp.hold_is_left_handed ? "L" : "R"), me.getSubText(), me.colour]; } else { if (size(wptName) == 2) { return[wptName[0] ~ wptName[1 ~ (me.wp.fly_type == "flyOver" ? "@" : "")], me.getSubText(), me.colour]; diff --git a/Nasal/MCDU/HOLD.nas b/Nasal/MCDU/HOLD.nas index a4613ac6..287c00a6 100644 --- a/Nasal/MCDU/HOLD.nas +++ b/Nasal/MCDU/HOLD.nas @@ -112,20 +112,28 @@ var holdPage = { if (index == 1) { if (size(me.scratchpad) <= 3 and num(me.scratchpad) != nil) { me.waypoint.hold_inbound_radial = me.scratchpad; + mcdu_scratchpad.scratchpads[me.computer].empty(); + me._setupPageWithData(); } else { mcdu_message(me.computer, "NOT ALLOWED"); } } else if (index == 2) { if (me.scratchpad == "L") { me.waypoint.hold_is_left_handed = 1; + mcdu_scratchpad.scratchpads[me.computer].empty(); + me._setupPageWithData(); } elsif (me.scratchpad == "R") { me.waypoint.hold_is_left_handed = 0; + mcdu_scratchpad.scratchpads[me.computer].empty(); + me._setupPageWithData(); } else { mcdu_message(me.computer, "NOT ALLOWED"); } } elsif (index == 3) { if (num(me.scratchpad) != nil) { me.waypoint.hold_time_or_distance = me.scratchpad; + mcdu_scratchpad.scratchpads[me.computer].empty(); + me._setupPageWithData(); } else { mcdu_message(me.computer, "NOT ALLOWED"); }