diff options
author | FaceDeer <derksenmobile@gmail.com> | 2017-01-04 19:23:21 -0700 |
---|---|---|
committer | FaceDeer <derksenmobile@gmail.com> | 2017-01-04 19:23:21 -0700 |
commit | 1ecb6964d9099d7314c3474c2a9c3caf8e6b40e6 (patch) | |
tree | 5fe4398b125ae164bdb38eb707d9314c1205b9bd /util.lua | |
parent | d545593f273430cb31966d6eb63aa44a229b76ef (diff) |
Builders no longer keep a real copy of the object they're "programmed" with. Also, add a "creative mode" configuration flag
Diffstat (limited to 'util.lua')
-rw-r--r-- | util.lua | 31 |
1 files changed, 17 insertions, 14 deletions
@@ -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, "") |