From 474347231a74f2d5130dd09527443cd706281e9a Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Wed, 30 Oct 2024 18:54:04 +0100 Subject: [PATCH] Mtn: fix weird bug --- maps/mountain_fortress_v3/icw/functions.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/maps/mountain_fortress_v3/icw/functions.lua b/maps/mountain_fortress_v3/icw/functions.lua index 0bc3e7aa..07774c0b 100644 --- a/maps/mountain_fortress_v3/icw/functions.lua +++ b/maps/mountain_fortress_v3/icw/functions.lua @@ -267,13 +267,15 @@ local function equal_fluid(source_tank, target_tank) amount = source_fluid.amount * 0.5 end - if amount <= 0 then + if amount <= 1 then return end - local inserted_amount = target_tank.insert_fluid({ name = source_fluid.name, amount = amount, temperature = source_fluid.temperature }) - if inserted_amount > 0 then - source_tank.remove_fluid({ name = source_fluid.name, amount = inserted_amount }) + if amount > 0 then + local inserted_amount = target_tank.insert_fluid({ name = source_fluid.name, amount = amount, temperature = source_fluid.temperature }) + if inserted_amount > 0 then + source_tank.remove_fluid({ name = source_fluid.name, amount = inserted_amount }) + end end end