mirror of
https://github.com/minetest-mods/drawers.git
synced 2024-11-22 22:53:46 +01:00
Fix duplicate items bug when inserting items from pipes (#13)
This commit is contained in:
parent
7d69f7d1a9
commit
fe409885f0
@ -189,11 +189,13 @@ function drawers.drawer_can_insert_object(pos, node, stack, direction)
|
|||||||
local drawer_visuals = drawers.drawer_visuals[core.serialize(pos)]
|
local drawer_visuals = drawers.drawer_visuals[core.serialize(pos)]
|
||||||
if not drawer_visuals then return false end
|
if not drawer_visuals then return false end
|
||||||
|
|
||||||
local leftover = stack
|
|
||||||
for _, visual in pairs(drawer_visuals) do
|
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)
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawers.register_drawer(name, def)
|
function drawers.register_drawer(name, def)
|
||||||
|
Loading…
Reference in New Issue
Block a user