1
0
Fork 0

Fix for issue 526 - Not possible to restart YASim aircraft after fuel starvation

This commit is contained in:
Stuart Buchanan 2011-12-28 09:09:28 +00:00
parent 093248ca3c
commit 3fb129923c

View file

@ -1,3 +1,6 @@
# Fuel handling for the YASim FDM. Note that other FDMs (e.g. JSBSim)
# handle fuel within the FDM itself.
#
# Properties under /consumables/fuel/tank[n]:
# + level-lbs - Current fuel load. Can be set by user code.
# + selected - boolean indicating tank selection.
@ -22,9 +25,6 @@ var update = func {
fuel.setDoubleValue(0);
}
if (!consumed_fuel)
return;
var selected_tanks = [];
foreach (var t; tanks) {
var cap = t.getNode("capacity-gal_us",0);
@ -71,6 +71,10 @@ var fuel_freeze = nil;
_setlistener("/sim/signals/fdm-initialized", func {
setlistener("/sim/freeze/fuel", func(n) { fuel_freeze = n.getBoolValue() }, 1);
# Fuel sub-system is only used by YASim. Other FDMs (e.g. JSBSim)
# handle fuel themselves.
if (getprop("/sim/flight-model") != "yasim") { return; }
engines = props.globals.getNode("engines", 1).getChildren("engine");
foreach (var e; engines) {
e.getNode("fuel-consumed-lbs", 1).setDoubleValue(0);