[2.0.72] Cloning boiler duplicates fluid inside

User avatar
FerrariMAF
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Fri May 26, 2017 11:39 am
Contact:

[2.0.72] Cloning boiler duplicates fluid inside

Post 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 }    
robot256
Smart Inserter
Smart Inserter
Posts: 1309
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.72] Cloning boiler duplicates fluid inside

Post 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.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
User avatar
FerrariMAF
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Fri May 26, 2017 11:39 am
Contact:

Re: [2.0.72] Cloning boiler duplicates fluid inside

Post 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 ?
robot256
Smart Inserter
Smart Inserter
Posts: 1309
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.72] Cloning boiler duplicates fluid inside

Post 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.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16271
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.72] Cloning boiler duplicates fluid inside

Post by Rseding91 »

Thanks for the report. This is now fixed for 2.1.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Fixed for 2.1”