From 5348c7f4caf8114c0558030076382c764f988d8a Mon Sep 17 00:00:00 2001 From: Josh Davidson Date: Sun, 26 Jun 2022 17:55:05 -0400 Subject: [PATCH] FMGC: Fix incorrect reversions to heading mode --- Nasal/FMGC/flightplan-delegates.nas | 4 +++- Nasal/FMGC/flightplan.nas | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Nasal/FMGC/flightplan-delegates.nas b/Nasal/FMGC/flightplan-delegates.nas index 553e45fe..61da23a7 100644 --- a/Nasal/FMGC/flightplan-delegates.nas +++ b/Nasal/FMGC/flightplan-delegates.nas @@ -268,7 +268,9 @@ var A320GPSDelegate = { me.flightplan.current = me.flightplan.current + 1; } else { logprint(LOG_INFO, "default GPS sequencing to next WP (special)"); - fmgc.Input.lat.setValue(3); + if (fmgc.Output.lat.getValue() == 1) { + fmgc.Input.lat.setValue(3); + } if (me.flightplan.nextWP().wp_type == 'vectors') { me.flightplan.current = me.flightplan.current + 2; } diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index 1be9fe10..8760962f 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -227,7 +227,9 @@ var flightPlanController = { # TODO - I think that it only goes to VS when in DES mode if (me.flightplans[2].getWP(me.currentToWptIndexTemp + 1).wp_type == "discontinuity" or me.flightplans[2].getWP(me.currentToWptIndexTemp + 1).wp_type == "vectors") { - fmgc.Input.lat.setValue(3); + if (fmgc.Output.lat.getValue() == 1) { + fmgc.Input.lat.setValue(3); + } me.currentToWptIndex.setValue(me.currentToWptIndexTemp + 2); me.lastSequencedCurrentWP = me.currentToWptIndexTemp + 2; } else {