Add missing placer nil-check
This commit is contained in:
parent
959bf2df58
commit
4d4dd9f614
1 changed files with 1 additions and 1 deletions
2
init.lua
2
init.lua
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue