Machines with fixed_recipe should keep their inventory when fast_replaced by the same recipe

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Machines with fixed_recipe should keep their inventory when fast_replaced by the same recipe

Post by DaveMcW »

Steps to reproduce:
1. Create some assembling machines with identical fixed_recipe.

Code: Select all

data.raw["assembling-machine"]["assembling-machine-1"].fixed_recipe = "iron-gear-wheel"
data.raw["assembling-machine"]["assembling-machine-2"].fixed_recipe = "iron-gear-wheel"
data.raw["assembling-machine"]["assembling-machine-3"].fixed_recipe = "iron-gear-wheel"
2. Build an assembling machine 1 and power it.
3. Insert 3 iron plates and let it craft an iron gear wheel.
4. Build an assembling machine 2 on top if it.

Actual result:
All iron plates and iron gear wheels are returned to player's inventory.

Expected result:
All iron plates and iron gear wheels stay in the assembling machine 2.
Also, progress should be kept instead of being reset.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Machines with fixed_recipe should keep their inventory when fast_replaced by the same recipe

Post by Reika »

DaveMcW wrote:
Wed Jun 03, 2020 4:03 am
Steps to reproduce:
1. Create some assembling machines with identical fixed_recipe.

Code: Select all

data.raw["assembling-machine"]["assembling-machine-1"].fixed_recipe = "iron-gear-wheel"
data.raw["assembling-machine"]["assembling-machine-2"].fixed_recipe = "iron-gear-wheel"
data.raw["assembling-machine"]["assembling-machine-3"].fixed_recipe = "iron-gear-wheel"
2. Build an assembling machine 1 and power it.
3. Insert 3 iron plates and let it craft an iron gear wheel.
4. Build an assembling machine 2 on top if it.

Actual result:
All iron plates and iron gear wheels are returned to player's inventory.

Expected result:
All iron plates and iron gear wheels stay in the assembling machine 2.
Also, progress should be kept instead of being reset.
I second this, and would like to add fluidbox contents (which are voided instead of returned to the player) to the "keep list".
Image

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

Re: Machines with fixed_recipe should keep their inventory when fast_replaced by the same recipe

Post by Rseding91 »

That sounds like a bug with the logic; normal fast-replace sticks the original items back into the entity if it can and only when that fails do the items go back to the player. The same should be happening for fluids.

It sounds like the code-branch for fixed_recipe is just not doing that for some reason.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding interface requests”