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

This subforum contains all the issues which we already resolved.
Post Reply
Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

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

Post 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 68 times
The same behaviour was observed in 1.1.62.
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

Thanks for the report, it's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”