Fix vine not dropping all vines when dug w/ shears

This commit is contained in:
Wuzzy 2019-02-22 06:08:48 +01:00
parent e614f9228a
commit 6e8be2a2c3

View file

@ -141,13 +141,14 @@ minetest.register_node("mcl_core:vine", {
return itemstack return itemstack
end, end,
-- If destroyed, also a “dependant” vine below it. -- If dug, also dig a “dependant” vine below it.
-- A vine is dependant if it hangs from this node and has no supporting block. -- A vine is dependant if it hangs from this node and has no supporting block.
after_destruct = function(pos, oldnode) on_dig = function(pos, node, digger)
local below = {x=pos.x, y=pos.y-1, z=pos.z} local below = {x=pos.x, y=pos.y-1, z=pos.z}
local belownode = minetest.get_node(below) local belownode = minetest.get_node(below)
if belownode.name == oldnode.name and (not mcl_core.check_vines_supported(below, belownode)) then minetest.node_dig(pos, node, digger)
minetest.remove_node(below) if belownode.name == node.name and (not mcl_core.check_vines_supported(below, belownode)) then
minetest.registered_nodes[node.name].on_dig(below, node, digger)
end end
end, end,