From: ShadowNinja Date: Tue, 11 Mar 2014 16:59:02 +0000 (-0400) Subject: Fix error when calling minetest.node_punch without a pointed_thing X-Git-Tag: 0.4.10~223 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c9b64206f9cc4f9332cc903816799fcafb4fb7c9;p=oweals%2Fminetest.git Fix error when calling minetest.node_punch without a pointed_thing --- diff --git a/builtin/item.lua b/builtin/item.lua index de546c2e7..002c14f5e 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -367,7 +367,7 @@ function minetest.node_punch(pos, node, puncher, pointed_thing) -- Copy pos and node because callback can modify them local pos_copy = vector.new(pos) local node_copy = {name=node.name, param1=node.param1, param2=node.param2} - local pointed_thing_copy = copy_pointed_thing(pointed_thing) + local pointed_thing_copy = pointed_thing and copy_pointed_thing(pointed_thing) or nil callback(pos_copy, node_copy, puncher, pointed_thing_copy) end end