Return an ItemStack in minetest.item_place() if nodes' on rightclick doesnt return it
authorPilzAdam <pilzadam@minetest.net>
Tue, 2 Apr 2013 13:18:05 +0000 (15:18 +0200)
committerPilzAdam <pilzadam@minetest.net>
Tue, 2 Apr 2013 13:19:02 +0000 (15:19 +0200)
builtin/item.lua

index 8e2f75a1a2a806ffed887f3a4e98631af32f796e..51a17106a60a3b73b31495f76ea0a25c6a6da0ab 100644 (file)
@@ -244,7 +244,7 @@ function minetest.item_place(itemstack, placer, pointed_thing)
                local n = minetest.env:get_node(pointed_thing.under)
                local nn = n.name
                if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then
-                       return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, placer, itemstack)
+                       return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, placer, itemstack) or itemstack
                end
        end