From 981325f64614d57f6d7e2e91a3ba96e3745e4d11 Mon Sep 17 00:00:00 2001 From: Matthew Maring <56924612+hayden2000@users.noreply.github.com> Date: Thu, 30 Jul 2020 07:54:02 -0400 Subject: [PATCH] Navigate to correct waypoint from VERTREV --- Nasal/MCDU/VERTREV.nas | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Nasal/MCDU/VERTREV.nas b/Nasal/MCDU/VERTREV.nas index 3f73810e..05513585 100644 --- a/Nasal/MCDU/VERTREV.nas +++ b/Nasal/MCDU/VERTREV.nas @@ -154,15 +154,17 @@ var vertRev = { fmgc.windController.accessPage[me.computer] = "VERTREV"; setprop("MCDU[" ~ me.computer ~ "]/page", "WINDDES"); } else if (me.wp.wp_role == nil and me.wp.wp_type == "navaid") { - if (canvas_mcdu.myCRZWIND[me.computer] == nil) { - cur_location = 0; - for (i = 0; i < size(fmgc.windController.nav_indicies[me.plan]); i += 1) { - if (fmgc.windController.nav_indicies[me.plan][i] == me.index) { - cur_location = i; - } + cur_location = 0; + for (i = 0; i < size(fmgc.windController.nav_indicies[me.plan]); i += 1) { + if (fmgc.windController.nav_indicies[me.plan][i] == me.index) { + cur_location = i; } + } + if (canvas_mcdu.myCRZWIND[me.computer] == nil) { canvas_mcdu.myCRZWIND[me.computer] = windCRZPage.new(me.computer, me.wp, cur_location); } else { + canvas_mcdu.myCRZWIND[me.computer].waypoint = me.wp; + canvas_mcdu.myCRZWIND[me.computer].cur_location = cur_location; canvas_mcdu.myCRZWIND[me.computer].reload(); } fmgc.windController.accessPage[me.computer] = "VERTREV";