CC: Tweaked

CC: Tweaked

57M Downloads

Parsing of NBT numbers is incorrect

SquidDev opened this issue ยท 1 comments

commented

Useful information to include:

  • CC: Tweaked version: 1.93.0

textutils.unserializeJSON should handle numbers like 1.0d, but it does not:

1.0d fails to parse

The bug is on this line. We should be using last instead of pos.

https://github.com/SquidDev-CC/CC-Tweaked/blob/01d81cb91da938836f953b290ad6b8fc87cb7e35/src/main/resources/data/computercraft/lua/rom/apis/textutils.lua#L494

Probably should write some tests for this too. Numbers like 0d work currently, but clearly I didn't test anything more complex!

commented

Also worth noting that we fail to correctly handle arrays of numbers (for instance, those starting with [I;). Again, this should be a fairly trivial fix.