diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index 980321a0..6dc7c622 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -420,7 +420,7 @@ var flightPlanController = { wpCoursePrev[n][wpt].setValue(courseDistanceFromPrev[0]); wpDistancePrev[n][wpt].setValue(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" and wpt <= me.arrivalIndex[n]) { - me._arrivalDist += courseDistanceFromPrev[1]; + me._arrivalDist += courseDistanceFromPrev[1]; # todo - buggy. Neglect discontinuity, and should show distance to next wpt, + distance thereafter } } else { # use PPOS for the first waypoint diff --git a/Nasal/MCDU/DEPARTURE.nas b/Nasal/MCDU/DEPARTURE.nas index 50e864ed..2b1b8412 100644 --- a/Nasal/MCDU/DEPARTURE.nas +++ b/Nasal/MCDU/DEPARTURE.nas @@ -251,6 +251,9 @@ var departurePage = { } if (me.selectedRunway != nil) { me._sids = me.depAirport[0].sids(me.selectedRunway.id); + if (size(me._sids) == 0) { # account for cases such as EGJJ where runway code does not match SIDS + me._sids = me.depAirport[0].sids(); + } } else { me._sids = me.depAirport[0].sids(); } diff --git a/Nasal/MCDU/F-PLN-rework.nas b/Nasal/MCDU/F-PLN-rework.nas index fc843f62..0b5380c0 100644 --- a/Nasal/MCDU/F-PLN-rework.nas +++ b/Nasal/MCDU/F-PLN-rework.nas @@ -309,8 +309,16 @@ var fplnPage = { # this one is only created once, and then updated - remember th } }, destInfo: func() { - me.L6 = [left(me.plan.getWP(fmgc.flightPlanController.arrivalIndex[me.planIndex]).wp_name, 4), " DEST", "wht"]; - me.C6 = ["---- " ~ int(fmgc.flightPlanController.arrivalDist), "TIME DIST", "wht"]; + if (me.plan.getWP(fmgc.flightPlanController.arrivalIndex[me.planIndex]) != nil) { + me.L6 = [left(me.plan.getWP(fmgc.flightPlanController.arrivalIndex[me.planIndex]).wp_name, 4), " DEST", "wht"]; + } else { + me.L6 = ["----", " DEST", "wht"]; + } + if (fmgc.flightPlanController.arrivalDist != nil) { + me.C6 = ["---- " ~ int(fmgc.flightPlanController.arrivalDist), "TIME DIST", "wht"]; + } else { + me.C6 = ["---- ----", "TIME DIST", "wht"]; + } me.R6 = ["--.-", "EFOB", "wht"]; }, update: func() {