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.
[0.17.32][Modding] LuaEntity.destroy() Returns True on Invalid Entity
- DedlySpyder
- Filter Inserter
- Posts: 253
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: [0.17.32][Modding] LuaEntity.destroy() Returns True on Invalid Entity
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.
If you want to get ahold of me I'm almost always on Discord.
- DedlySpyder
- Filter Inserter
- Posts: 253
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: [0.17.32][Modding] LuaEntity.destroy() Returns True on Invalid Entity
Maybe the API docs need updated to reflect that then?
Because currently they say the following:
Because currently they say the following:
Return value
if the entity was actually destroyed.