Support a "kill-when-empty" flag on tanks to enable the strict
"engines die when any tank is empty" behavior. Otherwise, just deselect the empty tank. This matches the "both" behavior many lightplane fuel selectors have.
This commit is contained in:
parent
057b31de46
commit
aa2686c0b9
1 changed files with 7 additions and 1 deletions
|
@ -60,7 +60,13 @@ fuelUpdate = func {
|
|||
ppg = t.getNode("density-ppg").getValue();
|
||||
lbs = t.getNode("level-gal_us").getValue() * ppg;
|
||||
lbs = lbs - fuelPerTank;
|
||||
if(lbs < 0) { lbs = 0; outOfFuel = 1; }
|
||||
if(lbs < 0) {
|
||||
lbs = 0;
|
||||
# Kill the engines if we're told to, otherwise simply
|
||||
# deselect the tank.
|
||||
if(t.getBoolValue("kill-when-empty")) { outOfFuel = 1; }
|
||||
else { t.setBoolValue("selected", 0); }
|
||||
}
|
||||
gals = lbs / ppg;
|
||||
t.getNode("level-gal_us").setDoubleValue(gals);
|
||||
t.getNode("level-lbs").setDoubleValue(lbs);
|
||||
|
|
Loading…
Add table
Reference in a new issue