From 35193737739180d42345f5564d27b38b005a301f Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 5 Jun 2012 23:09:18 +0300 Subject: [PATCH] place_node, dig_node and punch_node; an in-game tester tool; remove old code --- builtin/item.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/builtin/item.lua b/builtin/item.lua index 3d545ee..6d75fbf 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -250,10 +250,12 @@ function minetest.node_dig(pos, node, digger) wielded:add_wear(dp.wear) digger:set_wielded_item(wielded) - -- Add dropped items - local _, dropped_item - for _, dropped_item in ipairs(drops) do - digger:get_inventory():add_item("main", dropped_item) + -- Add dropped items to object's inventory + if digger:get_inventory() then + local _, dropped_item + for _, dropped_item in ipairs(drops) do + digger:get_inventory():add_item("main", dropped_item) + end end end