summaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua31
1 files changed, 17 insertions, 14 deletions
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, "")