diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index a06bb5bf..4c60ff75 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -96,15 +96,14 @@ var flightPlanController = { autoSequencing: func() { if (me.num[2].getValue() > 2) { if (me.temporaryFlag[0] == 1 and wpID[0][0] == wpID[2][0]) { - #me.deleteWP(0, 0); + me.deleteWP(0, 0); } if (me.temporaryFlag[1] == 1 and wpID[1][0] == wpID[2][0]) { - #me.deleteWP(0, 1); + me.deleteWP(0, 1); } - # me.deleteWP(0, 2, 0, 1); - me.currentToWptIndex.setValue(me.currentToWptIndex.getValue() + 1); + me.deleteWP(0, 2, 0, 1); } }, @@ -117,7 +116,7 @@ var flightPlanController = { me.flightplans[n].insertWP(createWP(geo.aircraft_position(), "PPOS"), 0); }, - deleteWP: func(index, n, a = 0, s = 0) { # a = 1, means adding a waypoint via deleting intermediate s = 1, means skip adding discontinuity + deleteWP: func(index, n, a = 0, s = 0) { # a = 1, means adding a waypoint via deleting intermediate var wp = wpID[n][index].getValue(); if (wp != FMGCdep.getValue() and wp != FMGCarr.getValue() and me.flightplans[n].getPlanSize() > 2) { if (me.flightplans[n].getWP(index).id != "DISCONTINUITY" and a == 0) { # if it is a discont, don't make a new one diff --git a/Nasal/MCDU/F-PLN-rework.nas b/Nasal/MCDU/F-PLN-rework.nas index 697d2956..d178058a 100644 --- a/Nasal/MCDU/F-PLN-rework.nas +++ b/Nasal/MCDU/F-PLN-rework.nas @@ -204,11 +204,11 @@ var fplnPage = { # this one is only created once, and then updated - remember th createPlanList: func() { me.planList = []; if (me.temporaryFlagFpln) { - for (var i = fmgc.flightPlanController.currentToWptIndex.getValue(); i < me.plan.getPlanSize(); i += 1) { + for (var i = 0; i < me.plan.getPlanSize(); i += 1) { append(me.planList, fplnItem.new(me.plan.getWP(i), i, me.plan, me.computer, "yel")); } } else { - for (var i = fmgc.flightPlanController.currentToWptIndex.getValue(); i < me.plan.getPlanSize(); i += 1) { + for (var i = 0; i < me.plan.getPlanSize(); i += 1) { append(me.planList, fplnItem.new(me.plan.getWP(i), i, me.plan, me.computer)); } }