[1.1.63] Linked container inventories are cleared when script fast-replacing
Posted: Sat Jul 30, 2022 3:45 pm
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).
The same behaviour was observed in 1.1.62.
Setup
Hover over any of the top chests and run this commandCode: 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 changedActual outcome
That chest now has iron in it, all other chests of type “linked-chest” are emptyWorkaround
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.The same behaviour was observed in 1.1.62.