From 64611f92d534622cd7f13557032747bd6589f548 Mon Sep 17 00:00:00 2001 From: Matthew Maring <56924612+hayden2000@users.noreply.github.com> Date: Sun, 3 May 2020 16:00:58 -0400 Subject: [PATCH] Fix reserve fuel bug --- Nasal/FMGC/FMGC.nas | 1 + Nasal/MCDU/INITB.nas | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index c6ff68ec..62b4437d 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -235,6 +235,7 @@ var updateFuel = func { if (trip_fuel < 400) { trip_fuel = 400; } + # if (low air conditioning) { # trip_fuel = trip_fuel * 0.995; #} diff --git a/Nasal/MCDU/INITB.nas b/Nasal/MCDU/INITB.nas index 647c7954..72993d57 100644 --- a/Nasal/MCDU/INITB.nas +++ b/Nasal/MCDU/INITB.nas @@ -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", "");