On Fri, 2006-10-06 at 19:30 -0400, Ampere K. Hardraade wrote:
> The problem probably stems from the following lines:
> 
> capacityTank0 = getprop("/consumables/fuel/tank[0]/capacity-gal_us");
> capacityTank1 = getprop("/consumables/fuel/tank[1]/capacity-gal_us");
> capacityTank2 = getprop("/consumables/fuel/tank[2]/capacity-gal_us");
> 
> I think, if your aircraft only has two tanks, for example, then capacityTank2 
> would be set to null (because the 
> property "/consumables/fuel/tank[2]/capacity-gal_us" wouldn't exist).  Then 
> in the comparesion in the later lines, in particular:
> 
> if (newLevelTank2 > capacityTank2)...
> 
> would give you that "nil used in numeric context" message.

Perhaps.. On closer observation I've noticed that none of the aircraft
on my system have the property:
"/consumables/fuel/tank[x]/capacity-gal_us"  when browsing via the
properties browser ... maybe this is the problem?



Daniel Pekelharing


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-users

Reply via email to