aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-06-05 23:09:18 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-06-05 23:10:07 +0300
commitc3658e7c797cbf5b9d04a6d950505d37dcdd422b (patch)
treeb8c50c53fbadcd076d6e1ab5c2561455911859c2 /builtin
parentb0f81c3253cb73c47d6e46a9ec75800a3679897c (diff)
downloadminetest-c3658e7c797cbf5b9d04a6d950505d37dcdd422b.tar.gz
minetest-c3658e7c797cbf5b9d04a6d950505d37dcdd422b.tar.bz2
minetest-c3658e7c797cbf5b9d04a6d950505d37dcdd422b.zip
place_node, dig_node and punch_node; an in-game tester tool; remove old code
Diffstat (limited to 'builtin')
-rw-r--r--builtin/item.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/builtin/item.lua b/builtin/item.lua
index 3d545eece..6d75fbf70 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