diff options
author | Weblate <noreply@weblate.org> | 2017-12-08 17:57:08 +0100 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-12-08 17:57:08 +0100 |
commit | aa287af788b80c239dd2fb62a1d12589e2ec6881 (patch) | |
tree | 4bc24a1693aebb271ef70e16492b038257e6f3c2 | |
parent | 224b146271b2759a2738660c2aa22f5caf1e42af (diff) | |
parent | fe409885f0532d10da2c9628873f2d4ce315e51f (diff) |
Merge remote-tracking branch 'origin/master'
-rwxr-xr-x | lua/api.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lua/api.lua b/lua/api.lua index 2bca40c..740e33e 100755 --- a/lua/api.lua +++ b/lua/api.lua @@ -189,11 +189,13 @@ 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) |