From: Lord89James Date: Mon, 11 Mar 2013 12:36:04 +0000 (+0100) Subject: Infinite tools in creative mode X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=90b095aa54b5a96b1100966adc0f083e9cb5409d;p=zefram%2Fminetest%2Fminetest_engine.git Infinite tools in creative mode --- diff --git a/builtin/item.lua b/builtin/item.lua index 85b4cc0e..799e46f7 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -330,10 +330,12 @@ function minetest.node_dig(pos, node, digger) 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) + if not minetest.setting_getbool("creative_mode") then + 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) + end -- Handle drops minetest.handle_node_drops(pos, drops, digger)