From 888fbbe81efe51b471308e92f7914b17fb0e8218 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Sun, 13 Feb 2022 18:07:58 +0000 Subject: [PATCH] Prevent modifying the TO waypoint --- Nasal/FMGC/flightplan.nas | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index 9e8cade1..69f34220 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -769,6 +769,12 @@ var flightPlanController = { return 3; } + if (index == me.currentToWptIndex.getValue()) { + return 1; + # TODO - implement the PPOS - DISCONT feature + # me.insertPPOS(thePlan, index - 1); + # me.addDiscontinuity(index - 1, thePlan, 1); + } if (!me.temporaryFlag[plan]) { if (text == "CLR" and me.flightplans[2].getWP(index).wp_name == "DISCONTINUITY") { @@ -784,6 +790,7 @@ var flightPlanController = { var thePlan = plan; } + # check waypoints database here var wpFromDB = WaypointDatabase.getWP(text); if (wpFromDB != nil) {