fix error in decomposing leaves placement code.

make sure that the node at the placed position is actually a decomposing
leaves variant before doing anything else. (this may not be the case,
since a node may start falling immediately after being placed.)
This commit is contained in:
trans_soup 2023-10-19 14:15:17 +02:00
parent a4f121ac24
commit 9c28941a6a

View file

@ -68,6 +68,8 @@ local decomposing_leaves_layers = 4
local after_place_stack = function (pos)
local node = minetest.get_node(pos)
if not blockgame.starts_with(node.name, modname .. ":leaves_decomposing") then return end
local below = pos + blockgame.vector.dirs.down
local below_node = minetest.get_node(below)
if not blockgame.starts_with(below_node.name, modname .. ":leaves_decomposing") then return end