From 470b2fbcc1c21e136659543bbbad0fffefb1b465 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 7 Mar 2020 15:20:20 +0000 Subject: [PATCH] Fix the CLR button, and fix distance calculation. Needs to neglect discontinuitites still, that broke agagin --- Nasal/FMGC/flightplan.nas | 4 +++- Nasal/MCDU/F-PLN-rework.nas | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index 4c60ff75..342c0af6 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -389,7 +389,9 @@ var flightPlanController = { courseDistanceFromPrev = waypointHashStore.courseAndDistanceFrom(geoPosPrev); wpCoursePrev[n][wpt].setValue(courseDistanceFromPrev[0]); wpDistancePrev[n][wpt].setValue(courseDistanceFromPrev[1]); - me._arrivalDist += courseDistanceFromPrev[1]; + if (me.flightplans[n].getWP(wpt - 1).wp_type != "vectors" and me.flightplans[n].getWP(wpt - 1).wp_type != "hdgToAlt" and me.flightplans[n].getWP(wpt).wp_type != "vectors" and me.flightplans[n].getWP(wpt).wp_type != "hdgToAlt") { + me._arrivalDist += courseDistanceFromPrev[1]; + } } else { # use PPOS for the first waypoint wpCoursePrev[n][wpt].setValue(courseDistanceFrom[0]); diff --git a/Nasal/MCDU/F-PLN-rework.nas b/Nasal/MCDU/F-PLN-rework.nas index d178058a..e815c3bc 100644 --- a/Nasal/MCDU/F-PLN-rework.nas +++ b/Nasal/MCDU/F-PLN-rework.nas @@ -298,10 +298,6 @@ var fplnPage = { # this one is only created once, and then updated - remember th } }, pushButtonLeft: func(index) { - if (left(me.L6[0], 4) == getprop("/FMGC/internal/dep-arpt") and size(getprop("/MCDU[" ~ me.computer ~ "]/scratchpad")) > 0) { - notAllowed(me.computer); - return; - } if (index == 6) { if (fmgc.flightPlanController.temporaryFlag[me.computer]) { fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);