Reserve bug fix
This commit is contained in:
parent
ba89dfec12
commit
3fd56ef973
1 changed files with 8 additions and 2 deletions
|
@ -228,11 +228,17 @@ var updateFuel = func {
|
|||
setprop("/FMGC/internal/lw", num(getprop("/FMGC/internal/tow") - getprop("/FMGC/internal/trip-fuel")));
|
||||
|
||||
# Calculate reserve fuel
|
||||
if (getprop("/FMGC/internal/rte-percent-set")) {
|
||||
if (getprop("/FMGC/internal/rte-rsv-set")) {
|
||||
if (num(getprop("/FMGC/internal/trip-fuel")) == 0.0) {
|
||||
setprop("/FMGC/internal/rte-percent", 0.0);
|
||||
} else {
|
||||
setprop("/FMGC/internal/rte-percent", num(getprop("/FMGC/internal/rte-rsv") / getprop("/FMGC/internal/trip-fuel") * 100.0));
|
||||
}
|
||||
} else if (getprop("/FMGC/internal/rte-percent-set")) {
|
||||
setprop("/FMGC/internal/rte-rsv", num(getprop("/FMGC/internal/trip-fuel") * (100.0 - getprop("/FMGC/internal/rte-percent")) / 100.0));
|
||||
} else {
|
||||
if (num(getprop("/FMGC/internal/trip-fuel")) == 0.0) {
|
||||
setprop("/FMGC/internal/rte-percent", 0.0);
|
||||
setprop("/FMGC/internal/rte-percent", 5.0);
|
||||
} else {
|
||||
setprop("/FMGC/internal/rte-percent", num(getprop("/FMGC/internal/rte-rsv") / getprop("/FMGC/internal/trip-fuel") * 100.0));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue