Page 1 of 1

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

Posted: Wed Jun 03, 2020 4:03 am
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.

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

Posted: Wed Aug 12, 2020 3:48 pm
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".

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

Posted: Thu Aug 13, 2020 5:36 pm
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.