What?
If you try to set the slot of a constant-combinator to a virtual signal via script, this will error if no quality is provided. According to the description of SignalFilter (used by LuaLogisticSection::set_slot(), which has to be used for constant-combinators), all properties except name are optional. The documentation mentions that the value of quality can be "nil for any quality". However, it seems to be mandatory if type is "virtual".I consider this a bug in either the implementation or the documentation.
How to reproduce
Run the following from the chat console in a vanilla game:Code: Select all
/c p = game.player; pos = p.position
cc = p.surface.create_entity{name = "constant-combinator", force = p.force, position = {pos.x + 3, pos.y}}
s = cc.get_control_behavior().sections[1]
s.set_slot(1, {min = 1, value = {type = "virtual", name = "signal-A", quality = "normal"}})
s.set_slot(1, {min = 1, value = {type = "virtual", name = "signal-B"}})
Code: Select all
Cannot execute command. Error: Can't specify non zero request with non trivial item filter condition.