Fix itemshow item dupe bugs

This commit is contained in:
Wuzzy 2022-07-17 17:17:30 +02:00
parent 178e4c119f
commit b865c09be4

View File

@ -119,11 +119,14 @@ local on_rightclick = function(pos, node, clicker, itemstack)
minetest.sound_play({name="rp_itemshow_take_item", gain=0.5}, {pos=pos}, true) minetest.sound_play({name="rp_itemshow_take_item", gain=0.5}, {pos=pos}, true)
end end
else else
inv:set_stack("main", 1, itemstack) if itemstack:is_empty() then
update_item(pos, node) return itemstack
if not itemstack:is_empty() then
minetest.sound_play({name="rp_itemshow_put_item", gain=0.5}, {pos=pos}, true)
end end
local put_itemstack = ItemStack(itemstack)
put_itemstack:set_count(1)
inv:set_stack("main", 1, put_itemstack)
update_item(pos, node)
minetest.sound_play({name="rp_itemshow_put_item", gain=0.5}, {pos=pos}, true)
if not creative then if not creative then
itemstack:take_item() itemstack:take_item()
end end