diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-07-25 14:07:45 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-07-25 14:07:45 +0300 |
commit | 0a18dda158e8f256de121ed2cf7a7a161a083b1c (patch) | |
tree | 35aaf6111a3694661e5d602481809830fbc7176f /builtin | |
parent | 9eaf93d41d6745b877f8f52cf54b21050abefda1 (diff) | |
download | minetest-0a18dda158e8f256de121ed2cf7a7a161a083b1c.tar.gz minetest-0a18dda158e8f256de121ed2cf7a7a161a083b1c.tar.bz2 minetest-0a18dda158e8f256de121ed2cf7a7a161a083b1c.zip |
Remove special handling of creative mode
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/item.lua | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/builtin/item.lua b/builtin/item.lua index 2a9b4ff27..1b4b4d25a 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -273,25 +273,23 @@ function minetest.node_dig(pos, node, digger) minetest.log('action', digger:get_player_name() .. " digs " .. node.name .. " at " .. minetest.pos_to_string(pos)) - if not minetest.setting_getbool("creative_mode") then - local wielded = digger:get_wielded_item() - local drops = minetest.get_node_drops(node.name, wielded:get_name()) - - -- Wear out tool - local tp = wielded:get_tool_capabilities() - local dp = minetest.get_dig_params(def.groups, tp) - wielded:add_wear(dp.wear) - digger:set_wielded_item(wielded) - - -- 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 + local wielded = digger:get_wielded_item() + local drops = minetest.get_node_drops(node.name, wielded:get_name()) + + -- Wear out tool + local tp = wielded:get_tool_capabilities() + local dp = minetest.get_dig_params(def.groups, tp) + wielded:add_wear(dp.wear) + digger:set_wielded_item(wielded) + + -- 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 - + local oldmetadata = nil if def.after_dig_node then oldmetadata = minetest.env:get_meta(pos):to_table() |