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.
[1.1.25] Cannot write "nil" to LuaEntity::entity_label
[1.1.25] Cannot write "nil" to LuaEntity::entity_label
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Re: [1.1.25] Cannot write "nil" to LuaEntity::entity_label
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.
Re: [1.1.25] Cannot write "nil" to LuaEntity::entity_label
Thanks and Sorry! I keep getting them mixed up.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.