1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-14 02:34:09 +02:00

Mtn: fix weird bug

This commit is contained in:
Gerkiz 2024-10-30 18:54:04 +01:00
parent 26f45826aa
commit 474347231a

View File

@ -267,13 +267,15 @@ local function equal_fluid(source_tank, target_tank)
amount = source_fluid.amount * 0.5 amount = source_fluid.amount * 0.5
end end
if amount <= 0 then if amount <= 1 then
return return
end end
local inserted_amount = target_tank.insert_fluid({ name = source_fluid.name, amount = amount, temperature = source_fluid.temperature }) if amount > 0 then
if inserted_amount > 0 then local inserted_amount = target_tank.insert_fluid({ name = source_fluid.name, amount = amount, temperature = source_fluid.temperature })
source_tank.remove_fluid({ name = source_fluid.name, amount = inserted_amount }) if inserted_amount > 0 then
source_tank.remove_fluid({ name = source_fluid.name, amount = inserted_amount })
end
end end
end end