From ebfaa286378db61fb12a7f0133e645d8c6b6277e Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Thu, 19 May 2022 21:38:22 +0100 Subject: [PATCH] Revert "Fix logic error in SID discontinuity logic" This reverts commit c39fddb05b1a708b50b3cf2e6a8a39745df121a6. --- Nasal/FMGC/flightplan-delegates.nas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nasal/FMGC/flightplan-delegates.nas b/Nasal/FMGC/flightplan-delegates.nas index 2cecfa6b..fff9b3d5 100644 --- a/Nasal/FMGC/flightplan-delegates.nas +++ b/Nasal/FMGC/flightplan-delegates.nas @@ -75,9 +75,9 @@ var A320RouteManagerDelegate = { } me.flightplan.insertWaypoints(wps, 1); - + for (var wpIdx = 0; wpIdx < me.flightplan.getPlanSize(); wpIdx = wpIdx + 1) { - if (me.flightplan.getWP(wpIdx).wp_type == "vectors" and me.flightplan.getWP(wpIdx + 1) != nil and me.flightplan.getWP(wpIdx + 1).wp_type != "discontinuity") { + if (me.flightplan.getWP(wpIdx).wp_type == "vectors" and (me.flightplan.getWP(wpIdx + 1) == nil or me.flightplan.getWP(wpIdx + 1).wp_type != "discontinuity")) { me.flightplan.insertWP(createDiscontinuity(), wpIdx + 1); } }