Fixed the bug increasing the leftover itemstack count if the furniture cant be placed
This commit is contained in:
parent
4c99d42738
commit
455b99fb7d
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user