Add missing placer nil-check

This commit is contained in:
philipmi 2022-12-07 16:17:04 +01:00
parent 959bf2df58
commit 4d4dd9f614

View file

@ -35,7 +35,7 @@ local add_fruit_regrowable = function(fruit, node, leaves)
}) })
minetest.register_on_placenode(function(pos, newnode, placer) minetest.register_on_placenode(function(pos, newnode, placer)
if placer:is_player() and newnode.name == "cacaotree:pod" then if placer and placer:is_player() and newnode.name == "cacaotree:pod" then
minetest.set_node(pos, {name = "regrowing_fruits:cacao", param2 = newnode.param2}) minetest.set_node(pos, {name = "regrowing_fruits:cacao", param2 = newnode.param2})
end end
end) end)