Fixed the bug increasing the leftover itemstack count if the furniture cant be placed

This commit is contained in:
Andrey2470T 2024-12-14 14:27:04 +03:00
parent 4c99d42738
commit 455b99fb7d
2 changed files with 5 additions and 6 deletions

View File

@ -114,8 +114,9 @@ function multidecor.placement.check_for_placement(pos, placer, itemstack)
if not can_be_placed then
minetest.remove_node(pos)
itemstack:set_count(itemstack:get_count()+1)
return itemstack
else
itemstack:set_count(itemstack:get_count()-1)
end
return itemstack
end

View File

@ -97,9 +97,7 @@ function multidecor.register.build_description(name, base_desc)
end
function multidecor.register.after_place_node(pos, placer, itemstack)
local leftover = multidecor.placement.check_for_placement(pos, placer, itemstack)
return leftover
return multidecor.placement.check_for_placement(pos, placer, itemstack)
end
function multidecor.register.on_punch(pos, node, puncher)