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

Bugs that are actually features.
User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

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

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14318
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
DedlySpyder
Filter Inserter
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

Post 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.
Post Reply

Return to “Not a bug”