1
0
Fork 0

Fix reserve fuel bug

This commit is contained in:
Matthew Maring 2020-05-03 16:00:58 -04:00
parent 1ce894ed90
commit 64611f92d5
2 changed files with 7 additions and 2 deletions

View file

@ -235,6 +235,7 @@ var updateFuel = func {
if (trip_fuel < 400) {
trip_fuel = 400;
}
# if (low air conditioning) {
# trip_fuel = trip_fuel * 0.995;
#}

View file

@ -53,10 +53,14 @@ var initInputB = func(key, i) {
setprop("/FMGC/internal/fuel-calculating", 1);
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
}
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7 and tf / num(getprop("/FMGC/internal/trip-fuel")) <= 0.15) {
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) {
setprop("/FMGC/internal/rte-rsv", scratchpad);
setprop("/FMGC/internal/rte-rsv-set", 1);
setprop("/FMGC/internal/rte-percent", scratchpad / num(getprop("/FMGC/internal/trip-fuel")) * 100);
if (scratchpad / num(getprop("/FMGC/internal/trip-fuel")) * 100 > 15.0) {
setprop("/FMGC/internal/rte-percent", scratchpad / num(getprop("/FMGC/internal/trip-fuel")) * 100);
} else {
setprop("/FMGC/internal/rte-percent", 15.0); # need reasearch on this value
}
setprop("/FMGC/internal/rte-percent-set", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");