diff options
author | root <root@linuxworks.belug.de> | 2017-12-05 22:54:46 +0100 |
---|---|---|
committer | root <root@linuxworks.belug.de> | 2017-12-05 22:54:46 +0100 |
commit | 06d96c5bfc2f11ffb8a5252bd543efdac16cc652 (patch) | |
tree | b4ccfedb26accd676d794ab3a57d082972bddeab /lua/api.lua | |
parent | bad9599a5babbc9a8ca0b7f26a165e50c64c3144 (diff) | |
parent | a74ccca39f50c56cf4a0da8ed709948e675b4ce5 (diff) |
Merge https://github.com/gpcf/drawers
Conflicts:
lua/api.lua
Diffstat (limited to 'lua/api.lua')
-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) |