Page 1 of 1

[2.0.72] Cloning boiler duplicates fluid inside

Posted: Wed Nov 05, 2025 11:51 am
by FerrariMAF
Playing a mod with lots os cloning events, I have noticed that fluid storage was raising when it should not...
After some tests in my mod, I found that when a boiler is cloned, the water inside it is duplicated.

How to reproduce: use this console command

Code: Select all

/c local player = game.player local surface = player.surface local pos = player.position  local boiler = surface.create_entity{name = "boiler", position = {pos.x + 2, pos.y}, force = player.force} if boiler and boiler.valid then boiler.fluidbox[1] = {name = "water", amount = 50, temperature = 15} boiler.fluidbox[2] = {name = "steam", amount = 50, temperature = 150} end  local source_area = {{pos.x + 1.5, pos.y - 0.5}, {pos.x + 2.5, pos.y + 0.5}} local destination_area = {{pos.x + 14.5, pos.y - 0.5}, {pos.x + 15.5, pos.y + 0.5}}  surface.clone_area{   source_area = source_area,   destination_area = destination_area,   clone_tiles = false,   clone_entities = true,   expand_map = true }    

Re: [2.0.72] Cloning boiler duplicates fluid inside

Posted: Wed Nov 05, 2025 4:56 pm
by robot256
Cloning by definition copies all characteristics, including chest contents and fluid contents. If you want the new entity to be empty, you will have to empty it by script after cloning. Or you can use create_entity() and manually copy the properties that you want to preserve.

Re: [2.0.72] Cloning boiler duplicates fluid inside

Posted: Wed Nov 05, 2025 6:14 pm
by FerrariMAF
robot256 wrote: Wed Nov 05, 2025 4:56 pm Cloning by definition copies all characteristics, including chest contents and fluid contents. If you want the new entity to be empty, you will have to empty it by script after cloning. Or you can use create_entity() and manually copy the properties that you want to preserve.
I dont want it to be empty. It should be the same as the source, including internal fluids, shouldn't it ?

Re: [2.0.72] Cloning boiler duplicates fluid inside

Posted: Wed Nov 05, 2025 6:45 pm
by robot256
You mean the cloned boiler has *more* fluid than the original one? That's a good bug to report. I didn't initially understand from your use of the word "raising"-- the word "increasing" would be more correct here.

I confirmed the bug with your reproduction command. The first boiler has 50 water in it, and the cloned copy has 100 water in it. It does seem like the fluidbox cloning code is inserting the cloned fluid twice, or something like that.

Re: [2.0.72] Cloning boiler duplicates fluid inside

Posted: Wed Nov 05, 2025 7:54 pm
by Rseding91
Thanks for the report. This is now fixed for 2.1.