Avoid div-by-zero and NaN-property error
required for non-engine aircraft (UFO, gliders).
This commit is contained in:
parent
98277733d5
commit
b85838b770
1 changed files with 4 additions and 1 deletions
|
@ -152,7 +152,10 @@ var update_loop = func {
|
||||||
|
|
||||||
setprop("/consumables/fuel/total-fuel-gals", gals);
|
setprop("/consumables/fuel/total-fuel-gals", gals);
|
||||||
setprop("/consumables/fuel/total-fuel-lbs", lbs);
|
setprop("/consumables/fuel/total-fuel-lbs", lbs);
|
||||||
setprop("/consumables/fuel/total-fuel-norm", gals / cap);
|
if (cap == 0)
|
||||||
|
setprop("/consumables/fuel/total-fuel-norm", 0);
|
||||||
|
else
|
||||||
|
setprop("/consumables/fuel/total-fuel-norm", gals / cap);
|
||||||
|
|
||||||
foreach (var e; engines)
|
foreach (var e; engines)
|
||||||
e.getNode("out-of-fuel", 1).setBoolValue(out_of_fuel);
|
e.getNode("out-of-fuel", 1).setBoolValue(out_of_fuel);
|
||||||
|
|
Loading…
Add table
Reference in a new issue