diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2017-12-05 22:49:28 +0100 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2017-12-05 22:49:28 +0100 |
commit | 0f2e840ba6485c705a356225e4d5acb76cffb66d (patch) | |
tree | 66d870d49fe59f61ff68b9cd084d7b7ea0a18828 | |
parent | 34a710298cc2ddd719113573d1938df5dca67860 (diff) |
Bugfix: Fix duplicate items when inserting from tubes
-rwxr-xr-x | lua/api.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lua/api.lua b/lua/api.lua index 2bca40c..4eb9e27 100755 --- a/lua/api.lua +++ b/lua/api.lua @@ -189,11 +189,12 @@ function drawers.drawer_can_insert_object(pos, node, stack, direction) local drawer_visuals = drawers.drawer_visuals[core.serialize(pos)] if not drawer_visuals then return false end - local leftover = stack for _, visual in pairs(drawer_visuals) do - leftover = visual:try_insert_stack(leftover, true) + if visual.itemName == "" or (visual.itemName == stack:get_name() and visual.count ~= visual.maxCount) then + return true + end end - return not (leftover == stack) + return false end function drawers.register_drawer(name, def) |