Page 1 of 1

[1.1.63] Linked container inventories are cleared when script fast-replacing

Posted: Sat Jul 30, 2022 3:45 pm
by Xorimuth
To reproduce, load this save, which uses my Filter Chests mod to add an alternative linked chest prototype. (The fact that it is filtered is irrelevant to the bug report).
Setup
Hover over any of the top chests and run this command

Code: Select all

/c chest = game.player.selected game.player.surface.create_entity{name = "fc-filter-linked-chest", position = chest.position, force = chest.force, fast_replace = true}
Expected outcome
That chest now has iron in it, all other chests are not changed
Actual outcome
That chest now has iron in it, all other chests of type “linked-chest” are empty
Workaround
In my mod I am no longer using fast_replace = true when chest.type == "linked-container", instead I am copying the link_id myself and destroying the old chest afterwards.
linked-chest-bug.zip
(1.15 MiB) Downloaded 86 times
The same behaviour was observed in 1.1.62.

Re: [1.1.63] Linked container inventories are cleared when script fast-replacing

Posted: Sun Jul 31, 2022 2:40 pm
by Rseding91
Thanks for the report, it's now fixed for the next release.