From 084e166d7710d63a7af1ffed99763f0280376d5f Mon Sep 17 00:00:00 2001 From: Oversword Date: Tue, 26 Jan 2021 20:42:44 +0000 Subject: [PATCH] Use item stack count to avoid overfilling --- techpack_warehouse/common.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/techpack_warehouse/common.lua b/techpack_warehouse/common.lua index 659290e..f954f8e 100644 --- a/techpack_warehouse/common.lua +++ b/techpack_warehouse/common.lua @@ -209,7 +209,8 @@ function techpack_warehouse.allow_metadata_inventory_put(self, pos, listname, in local main_stack = inv:get_stack("main", index) local item_name = inv:get_stack("filter", index):get_name() if listname == "input" and item_name == stack:get_name() then - return math.min(stack:get_count(), self.inv_size - main_stack:get_count()) + local input_stack = inv:get_stack("input", index) + return math.min(stack:get_count(), self.inv_size - main_stack:get_count() - input_stack:get_count()) elseif listname == "filter" and item_name == main_stack:get_name() then return 1 elseif listname == "shift" then