construction plan bugfix, tank changed

master
Joachim Stolberg 2020-02-16 19:53:40 +01:00
parent 9b2a6024d0
commit 87db6be6fc
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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},
}