Jump to content




Shouldn't turtle.getFuelLevel() return math.huge (infinity) when fuel is disabled?


4 replies to this topic

#1 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 05 April 2014 - 09:10 PM

Likewise, turtle.getFuelLimit() would also return math.huge. This would pretty much remove the need for checks against the current return, "unlimited", as the common check of "if turtle.getFuelLevel() == 0 then" would return false, but also "< 1" or "< someOtherNumber" wouldn't fail with a string comparison error.

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 April 2014 - 12:21 AM

Sounds like it'd simplify things for future code, while retaining near full backwards compatibility with older code. Hmm.

#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 06 April 2014 - 12:26 AM

View PostBomb Bloke, on 06 April 2014 - 12:21 AM, said:

while retaining near full backwards compatibility with older code.
Well that has been thrown out the window with ComputerCraft 1.6 lots of old scripts have been broken with just the Term API changes alone. I feel like retaining backward compatibility is no longer a priority when making the change for the better.

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 April 2014 - 01:34 AM

I am scratching my head over those alterations. Granted, they're the better way of doing things, but they resolve what seems to be a very minor issue (to me).

However, 1.6 also has the potential to break old Rednet implementations, and can play havoc with scripts that implement turtle fuelling. I guess Dan thought if scripts were going to need changes anyway to cope with those, he may as well "fix" term while he was at it. Better to break a lot of things in one go then to spread 'em out over a number of updates.

#5 apemanzilla

  • Members
  • 1,421 posts

Posted 07 April 2014 - 03:56 PM

View PostBomb Bloke, on 06 April 2014 - 01:34 AM, said:

I am scratching my head over those alterations. Granted, they're the better way of doing things, but they resolve what seems to be a very minor issue (to me).

However, 1.6 also has the potential to break old Rednet implementations, and can play havoc with scripts that implement turtle fuelling. I guess Dan thought if scripts were going to need changes anyway to cope with those, he may as well "fix" term while he was at it. Better to break a lot of things in one go then to spread 'em out over a number of updates.

Just like Mojang ;)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users