Check whether sedge is fully grown *before* searching the surrounding nodes

This commit is contained in:
Jeremy Hussell 2024-09-10 20:47:43 +00:00
parent f9ba0f52dd
commit 068a13aa24

View File

@ -123,12 +123,12 @@ minetest.register_abm({
return minetest.remove_node(pos)
end
if #nodecore.find_nodes_around(pos, "group:moist", {2, 1, 2}) < 1
then return end
local lv = allsedges[node.name]
local grow = lv and allsedges[lv + 1]
if grow then
if #nodecore.find_nodes_around(pos, "group:moist", {2, 1, 2}) < 1
then return end
nodecore.set_loud(pos, {name = grow, param2 = 2})
return nodecore.witness(pos, "sedge growth")
end