Page 1 of 1

[raiguard][2.0.69] Fluids get voided, even when switching to compatible recipe

Posted: Sun Oct 12, 2025 12:47 am
by Gotbread
1. What did i do?

Created a mod with 2 recipes, both have the same fluid input:

Code: Select all

        ingredients =
        {
            {type = "fluid", name = "crude-oil", amount = 10},
            {type = "fluid", name = "water", amount = 10},
        },
and different outputs (one makes an iron plate, another makes a copper plate, so i can quickly see the output).
Now i switch between them:
- manually via the GUI: clicking the "change recipe" button, select the other recipe, observe that the machine is now assembling the new recipe
- via set_recipe in the console
- via set_recipe in my control.lua script

2. What happened?

The plant switches to the new recipe, aborting the progress, and also voiding both fluid ingredients. Each time i switch, it voids more fluid.

3. What did you expect to happen?

I expect that the fluid gets pushed back to the fluid network (there is space to absorb it).
This is related to this issue:
viewtopic.php?p=599670#p599670
relevant part:
It works this way so fluid for a given recipe gets re-used for the next one if they are acceptable.
The new recipe is compatible with the old one (it uses the exact 2 same fluid inputs and no item input), and yet, the fluid is voided. It is not pushed back or reused.

4. Does it happen always?
Yes, both with the stable version, and also the experimental (2.0.69 (build 84148 expansion, linux 64))

My 2 cents:
I agree that handling this case *in general* is tricky. But in the case that both recipes are 1-to-1 compatible on the input, voiding the liquid is not needed, so it would be nice if we can keep the liquid (or have a workaround in the script/recipe to allow for such behaviour).

Setup:
Bildschirmfoto vom 2025-10-12 02-40-47.png
Bildschirmfoto vom 2025-10-12 02-40-47.png (1.02 MiB) Viewed 190 times
switching between the 2 recipes was done manually, and also with the console command /c game.player.selected.set_recipe("s1") and /c game.player.selected.set_recipe("s2")

(Logfile attached)