1
0
Fork 0

Bugfix for landing - reset arrival index (thanks @stdg!)

This commit is contained in:
legoboyvdlp R 2020-06-23 00:07:00 +01:00
parent e563df87c8
commit 3adabd6317

View file

@ -168,6 +168,7 @@ var flightPlanController = {
me.destroyTemporaryFlightPlan(0, 0);
me.destroyTemporaryFlightPlan(1, 0);
me.currentToWptIndex.setValue(0);
me.arrivalIndex = [0, 0, 0]; # reset arrival index calculations
}
me.addDiscontinuity(1, plan);
@ -823,6 +824,12 @@ var flightPlanController = {
}
}
}
if (me.flightplans[2].getWP(me.arrivalIndex[2]) == nil or me.flightplans[2].getWP(1) == nil) {
me.arrivalDist = 9999;
print(me.arrivalIndex[2]);
}
me.arrivalDist = me.flightplans[2].getWP(me.arrivalIndex[2]).distance_along_route - me.flightplans[2].getWP(1).leg_distance + me._arrivalDist;
me.updateMCDUDriver(n);
},