mirror of
https://github.com/minetest-mods/technic.git
synced 2024-08-20 21:44:14 +02:00
Drill and laser: call node-specific on_dig (#556)
This properly digs nodes that have a custom on_dig function specified. For normal nodes, the behaviour is kept the same.
This commit is contained in:
parent
6154a04c00
commit
00618d13b5
@ -57,7 +57,9 @@ local function drill_dig_it0 (pos,player)
|
|||||||
if node.name == "default:lava_flowing" then return end
|
if node.name == "default:lava_flowing" then return end
|
||||||
if node.name == "default:water_source" then minetest.remove_node(pos) return end
|
if node.name == "default:water_source" then minetest.remove_node(pos) return end
|
||||||
if node.name == "default:water_flowing" then minetest.remove_node(pos) return end
|
if node.name == "default:water_flowing" then minetest.remove_node(pos) return end
|
||||||
minetest.node_dig(pos,node,player)
|
local def = minetest.registered_nodes[node.name]
|
||||||
|
if not def then return end
|
||||||
|
def.on_dig(pos, node, player)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function drill_dig_it1 (player)
|
local function drill_dig_it1 (player)
|
||||||
|
@ -46,7 +46,7 @@ local function laser_node(pos, node, player)
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
minetest.node_dig(pos, node, player)
|
def.on_dig(pos, node, player)
|
||||||
end
|
end
|
||||||
|
|
||||||
local keep_node = {air = true}
|
local keep_node = {air = true}
|
||||||
|
Loading…
Reference in New Issue
Block a user