Page 1 of 1

[1.1.109] LuaEntity.infinity_container_filters demands each filter have index on write

Posted: Sun Jun 23, 2024 5:18 pm
by curiosity
To reproduce:
1. In game execute the following command:

Code: Select all

/c game.player.surface.create_entity{name = 'infinity-chest', position = game.player.position}.infinity_container_filters = {{name = 'plastic-bar', count = 100}}
2. Observe error.
3. Execute the following command (the given value of index doesn't matter, only needs to be within 1..65536):

Code: Select all

/c game.player.surface.create_entity{name = 'infinity-chest', position = game.player.position}.infinity_container_filters = {{name = 'plastic-bar', count = 100, index = 100}}
4. Observe no error.

Expected behavior:
The filters are applied by the first command without issue, as per the docs the index field is not required for assigning filters. Or, if not that, the value of index has any effect at all.

Feel free to move this into the docs requests if you think the current pointless behavior is the correct one of the two.

Re: [1.1.109] LuaEntity.infinity_container_filters demands each filter have index on write

Posted: Mon Jun 24, 2024 1:36 am
by Rseding91
The index is used, but you didn't set the first 99 values so they got erased from the filters. The docs are specifically about set_infinity_container_filter