Bugfix for discontinuities; arrival page index typo
This commit is contained in:
parent
6e307654c1
commit
539344f1be
2 changed files with 18 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue