[1.1.25] Cannot write "nil" to LuaEntity::entity_label

Post Reply
robot256
Filter Inserter
Filter Inserter
Posts: 596
Joined: Sun Mar 17, 2019 1:52 am
Contact:

[1.1.25] Cannot write "nil" to LuaEntity::entity_label

Post by robot256 »

What happens:
LuaEntity::entity_label returns nil for entities without a label and spidertrons with no label set. (makes sense)
Writing an empty string "" clears the label, which is read back as nil. (makes sense)
Writing any string to an entity that does not support entity_label has no effect or error message. (makes sense)
Writing nil to LuaEntity::entity_label returns the error "Error: "label": string expected, got nil". (unexpected, because I read nil from it moments ago)

What I expect to happen:
Writing nil will clear the label, so that it is safe to write LuaEntity::entity_label with any result we can read from it.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.25] Cannot write "nil" to LuaEntity::entity_label

Post by Rseding91 »

Thanks for the report however that's not a bug; that's a modding interface request. It's a fine request but it doesn't go in bug reports.
If you want to get ahold of me I'm almost always on Discord.

robot256
Filter Inserter
Filter Inserter
Posts: 596
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [1.1.25] Cannot write "nil" to LuaEntity::entity_label

Post by robot256 »

Thanks and Sorry! I keep getting them mixed up.

Post Reply

Return to “Implemented mod requests”