From 87db6be6fcf133143a4c4760332093a4e06fa8cf Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 16 Feb 2020 19:53:40 +0100 Subject: [PATCH] construction plan bugfix, tank changed --- basis/liquid_lib.lua | 12 ++++++++++++ doc/plans.lua | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/basis/liquid_lib.lua b/basis/liquid_lib.lua index bffd3c9..ff40707 100644 --- a/basis/liquid_lib.lua +++ b/basis/liquid_lib.lua @@ -21,6 +21,7 @@ local BLOCKING_TIME = 0.3 -- 300ms techage.liquid = {} local LiquidDef = {} +local IsLiquid = {} local ContainerDef = {} local function help(x, y) @@ -69,6 +70,7 @@ function techage.register_liquid(full_container, empty_container, container_size LiquidDef[full_container] = {container = empty_container, size = container_size, inv_item = inv_item} ContainerDef[empty_container] = ContainerDef[empty_container] or {} ContainerDef[empty_container][inv_item] = full_container + IsLiquid[inv_item] = true end local function get_liquid_def(full_container) @@ -161,6 +163,16 @@ local function fill_on_punch(nvm, empty_container, item_count, puncher) end return item -- to be added to the players inv. end + elseif nvm.liquid.name and not IsLiquid[nvm.liquid.name] then + if empty_container == "" then + local count = math.max(nvm.liquid.amount, 99) + local name = nvm.liquid.name + nvm.liquid.amount = nvm.liquid.amount - count + if nvm.liquid.amount == 0 then + nvm.liquid.name = nil + end + return {name = name, count = count} + end end end diff --git a/doc/plans.lua b/doc/plans.lua index 2e84afc..929a18b 100644 --- a/doc/plans.lua +++ b/doc/plans.lua @@ -226,7 +226,7 @@ techage.ConstructionPlans["ta4_reactor"] = { {false, false, false, false, PN000, PIPEH, PIPEH, PN270, false, false, false}, {false, false, false, false, PIPEV, false, false, FILLR, false, false, false}, {false, false, false, false, PIPEV, false, false, REACT, false, false, false}, - {false, false, false, false, PIPEV, false, false, STAND, PIPEH, PIPEH, Tank}, + {false, false, false, false, PIPEV, false, false, STAND, PIPEH, PIPEH, SILO}, {false, Tank, PIPEH, PIPEH, DOSER, PN270, false, RBASE, PIPEH, PIPEH, Tank}, {false, SILO, PIPEH, PIPEH, PIPEH, PN180, false, false, false, false, false}, }