Skip to content

Commit

Permalink
corium dig nodes check format
Browse files Browse the repository at this point in the history
  • Loading branch information
nonfreegithub committed Nov 11, 2023
1 parent d176ce7 commit 2b39f6a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions technic/radiation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit 2b39f6a

Please sign in to comment.