1
0
Fork 0

Bugfix for discontinuities; arrival page index typo

This commit is contained in:
legoboyvdlp R 2020-06-02 16:37:30 +01:00
parent 6e307654c1
commit 539344f1be
2 changed files with 18 additions and 8 deletions

View file

@ -222,14 +222,24 @@ var flightPlanController = {
if (force) {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
if (index > 0) {
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY" and me.flightplans[plan].getWP(index - 1).wp_name != "DISCONTINUITY") {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
} else {
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY") {
if (me.flightplans[plan].getWP(index) != nil) { # index is not nil
if (me.flightplans[plan].getWP(index - 1) != nil) { # index -1 is also not nil
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY" and me.flightplans[plan].getWP(index - 1).wp_name != "DISCONTINUITY") {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
} else { # -1 is nil
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY") {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
}
} elsif (me.flightplans[plan].getWP(index - 1) != nil) { # index is nil, -1 is not
if (me.flightplans[plan].getWP(index - 1).wp_name != "DISCONTINUITY") {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
} else { # both are nil??
print("Possible error in discontinuities!");
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
},

View file

@ -711,9 +711,9 @@ var arrivalPage = {
me.updatePage();
} elsif (index == 6 and me.activePage != 2) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
setprop("/MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
} else {
setprop("/MCDU[" ~ i ~ "]/page", "LATREV");
setprop("/MCDU[" ~ me.computer ~ "]/page", "LATREV");
}
} elsif (me.activePage == 0 and index != 6) {
if (size(me.approaches) >= (index - 2) and index != 2) { # index = 3, size = 1