From 1ecb6964d9099d7314c3474c2a9c3caf8e6b40e6 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Wed, 4 Jan 2017 19:23:21 -0700 Subject: Builders no longer keep a real copy of the object they're "programmed" with. Also, add a "creative mode" configuration flag --- util.lua | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'util.lua') diff --git a/util.lua b/util.lua index e27e59b..2c1c967 100644 --- a/util.lua +++ b/util.lua @@ -42,20 +42,23 @@ digtron.mark_diggable = function(pos, nodes_dug) if target.name ~= "air" then local in_known_group = false local material_cost = 0 - if minetest.get_item_group(target.name, "cracky") ~= 0 then - in_known_group = true - material_cost = math.max(material_cost, digtron.dig_cost_cracky) - end - if minetest.get_item_group(target.name, "crumbly") ~= 0 then - in_known_group = true - material_cost = math.max(material_cost, digtron.dig_cost_crumbly) - end - if minetest.get_item_group(target.name, "choppy") ~= 0 then - in_known_group = true - material_cost = math.max(material_cost, digtron.dig_cost_choppy) - end - if not in_known_group then - material_cost = digtron.dig_cost_default + + if digtron.creative_mode ~= true then + if minetest.get_item_group(target.name, "cracky") ~= 0 then + in_known_group = true + material_cost = math.max(material_cost, digtron.dig_cost_cracky) + end + if minetest.get_item_group(target.name, "crumbly") ~= 0 then + in_known_group = true + material_cost = math.max(material_cost, digtron.dig_cost_crumbly) + end + if minetest.get_item_group(target.name, "choppy") ~= 0 then + in_known_group = true + material_cost = math.max(material_cost, digtron.dig_cost_choppy) + end + if not in_known_group then + material_cost = digtron.dig_cost_default + end end return material_cost, minetest.get_node_drops(target.name, "") -- cgit v1.2.3