From 2e14f13c46bc7049dc56e626583b90e82838de53 Mon Sep 17 00:00:00 2001 From: Andrey Kozlovskiy Date: Wed, 7 Aug 2019 21:46:32 +0300 Subject: [PATCH] Revert "Fix incorrect count check on item put" This reverts commit 3082c64dac5d5107d87c339559edfe3c4113eabe. (incorrect branch) --- tubelib/distributor.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tubelib/distributor.lua b/tubelib/distributor.lua index e4a1b27..d588910 100644 --- a/tubelib/distributor.lua +++ b/tubelib/distributor.lua @@ -142,19 +142,19 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player) local meta = M(pos) local inv = meta:get_inventory() local list = inv:get_list(listname) - local stack_count = stack:get_count() if minetest.is_protected(pos, player:get_player_name()) then return 0 end if listname == "src" then - if State:get_state(meta) == tubelib.STANDBY then + if State:get_state(M(pos)) == tubelib.STANDBY then State:start(pos, meta) end - return stack_count + return stack:get_count() + elseif invlist_num_entries(list) < MAX_NUM_PER_CYC then + return stack:get_count() end - - return math.min(stack_count, MAX_NUM_PER_CYC - invlist_num_entries(list)) + return 0 end local function allow_metadata_inventory_take(pos, listname, index, stack, player)