From 2b39f6a8622c8d46c8d33dcd56c88c889bc3f08b Mon Sep 17 00:00:00 2001 From: Freeman Date: Sat, 11 Nov 2023 11:26:06 +0100 Subject: [PATCH] corium dig nodes check format --- technic/radiation.lua | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/technic/radiation.lua b/technic/radiation.lua index 3f181ac7..8067df9e 100644 --- a/technic/radiation.lua +++ b/technic/radiation.lua @@ -561,18 +561,13 @@ if griefing then vector.new(0,0,-1), vector.new(0,-1,0), }) do - local vpos = vector.add(pos, offset) - local vnode = minetest.get_node(vpos) - local can_dig = true - if vnode and vnode.name and minetest.registered_nodes[vnode.name] then - local hardness = minetest.registered_nodes[vnode.name]._mcl_hardness - if hardness and type(hardness) == "number" then - can_dig = hardness > 0 + if math.random(8) == 1 then + local vpos = vector.add(pos, offset) + local def = minetest.registered_nodes[minetest.get_node(vpos).name] + if def and (not def._mcl_hardness or def._mcl_hardness > 0) then + minetest.dig_node(vpos) end end - if math.random(8) == 1 and can_dig then - minetest.dig_node(vpos) - end end end, })