Closed Lustyn closed 1 year ago
Funny thing is, Cobalt used to work like this, until SquidDev/Cobalt#62 was merged, which fixed the inconsistencies with PUC Lua that I also broke to match. I'll be reverting it back to the original/matching behavior by v2.7.3.
I'll transfer this to craftos2 for better tracking.
Problem
I'm not entirely sure how to accurately reproduce this issue, besides just showing this (annoyingly) complex scenario:
Compiling anything using moonscript-cc (you can use moonc to reproduce this) on the latest version of CraftOS-PC is wildly broken. This does not happen in CC:T, CCEmuX, PUC Lua, or CraftOS-PC Accelerated. As a short example, here's what happens:
becomes
I tried to debug this a bit, and the basic scenario seems as such:
t
) has several items inserted usingtable.insert
#t
returns 4 (the table really does have 4 items)table.getn(t)
, for an unknown reason returns 3table.insert
calls overwrite the 4th elementYou can see these artifacts in the fact that
_obj_0.a
is missing entirely,_obj_0.b
is rendered as_obj_0b
, et cetera.Fix
This is solved by simply using a commit of this Lua fork before 5517747. Not really sure what specifically in that commit causes this, but its absolutely not consistent with Cobalt 😳