If a script uses ffi.metatype and crashes unexpectedly,the next script startup produces this error : “cannot change a protected metatable”,this makes debugging real hard as I have to restart my game each time,any way to circumvent this?
Here’s a test script that demonstrates this issue,make sure to run it twice.
ffi.cdef[[
typedef struct {
float x,y;
} Crash;
]]
local Crash_Metatype = ffi.metatype("Crash",{})
print(x + y)