Fix thistle not getting dug by water properly

This commit is contained in:
Wuzzy 2019-08-31 16:06:34 +02:00
parent 272f3cdfd4
commit 8a15505df9
2 changed files with 8 additions and 2 deletions

View File

@ -131,11 +131,14 @@ minetest.register_lbm(
-- Vertical plants
function default.dig_up(pos, node, digger)
-- if digger == nil then return end
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
local nn = minetest.get_node(np)
if nn.name == node.name then
minetest.node_dig(np, nn, digger)
if digger then
minetest.node_dig(np, nn, digger)
else
minetest.remove_node(np)
end
end
end

View File

@ -1067,6 +1067,9 @@ minetest.register_node(
after_dig_node = function(pos, node, metadata, digger)
default.dig_up(pos, node, digger)
end,
on_flood = function(pos, oldnode, newnode)
default.dig_up(pos, oldnode)
end,
})
-- Food