Page 1 of 1

[0.17.32][Modding] LuaEntity.destroy() Returns True on Invalid Entity

Posted: Fri Apr 19, 2019 4:11 am
by DedlySpyder
I discovered this when teleporting a character across surfaces. The old character references are invalid, but calling .destroy() on them returns true.

I would expect it to fail for calling something on an invalid LuaEntity, or at least returning false.

Re: [0.17.32][Modding] LuaEntity.destroy() Returns True on Invalid Entity

Posted: Fri Apr 19, 2019 5:59 am
by Rseding91
Thanks for the report however that's not what the return value on destroy() means. It will only return false if it failed to destroy a valid entity.

Re: [0.17.32][Modding] LuaEntity.destroy() Returns True on Invalid Entity

Posted: Fri Apr 19, 2019 1:22 pm
by DedlySpyder
Maybe the API docs need updated to reflect that then?

Because currently they say the following:
Return value
if the entity was actually destroyed.