From b85838b77058c8991265806376547ac2e49a3a11 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Wed, 12 Jan 2011 20:13:57 +0100 Subject: [PATCH] Avoid div-by-zero and NaN-property error required for non-engine aircraft (UFO, gliders). --- Aircraft/Generic/aar.nas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Aircraft/Generic/aar.nas b/Aircraft/Generic/aar.nas index de77a5936..114d96bf8 100644 --- a/Aircraft/Generic/aar.nas +++ b/Aircraft/Generic/aar.nas @@ -152,7 +152,10 @@ var update_loop = func { setprop("/consumables/fuel/total-fuel-gals", gals); 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) e.getNode("out-of-fuel", 1).setBoolValue(out_of_fuel);