Page 1 of 1

[boskid][2.0.42] deconstruction planners entity_filters does not clear excess when overwritten

Posted: Mon Mar 24, 2025 1:56 am
by SunBlade
Issue
  • assigning a new table to the entity_filters property of a deconstruction planner does not replace ALL filter entries.
  • while a sparse table clears unassigned indices below its highest index, filter entries above its highest index will not be cleared.
How to reproduce

Code: Select all

local bp = game.player.cursor_stack -- use either this
local bp = game.blueprints[1] -- or this
local bp = magic -- or find your deconstruction planner any other way
-- once you have your deconstruction planner,
-- the below snippet should give a sparse pattern
local arr = {}
for k,v in pairs(bp.entity_filters) do
  arr[#arr+2] = v
end
bp.entity_filters = arr
  1. create a deconstruction planner.
  2. add some filters near the end.
  3. use the above code to assign a sparse table.
  • planner.png
    planner.png (2.94 MiB) Viewed 1306 times
  • the supplied example save has a planner to test.
  • repeated use of this console command shows the issue.
  • /c local bp = game.blueprints[1] local arr = {} for k,v in pairs(bp.entity_filters) do arr[#arr+2] = v end bp.entity_filters = arr
Expected result
  • filters are moved into a pattern at the beginning.
    expected.png
    expected.png (2.42 MiB) Viewed 1306 times
Actual result
  • filters at the end persist, until the new table reaches them.
    bug.png
    bug.png (2.76 MiB) Viewed 1306 times

Re: [boskid][2.0.42] deconstruction planners entity_filters does not clear excess when overwritten

Posted: Mon Mar 24, 2025 12:25 pm
by boskid
Thanks for the report. Issue is now fixed for 2.0.43.

Re: [boskid][2.0.42] deconstruction planners entity_filters does not clear excess when overwritten

Posted: Tue Mar 25, 2025 4:26 pm
by SunBlade
Thanks for the fast work. but ...
the exact same bug is also present for tile_filters.

Re: [boskid][2.0.42] deconstruction planners entity_filters does not clear excess when overwritten

Posted: Tue Mar 25, 2025 4:56 pm
by boskid
SunBlade wrote: Tue Mar 25, 2025 4:26 pm Thanks for the fast work. but ...
the exact same bug is also present for tile_filters.
I see. This is now also fixed for 2.0.43.