Add nil checks for placer
This commit is contained in:
parent
3ae382c913
commit
a2d7678ffd
14 changed files with 72 additions and 53 deletions
|
@ -334,7 +334,7 @@ end
|
|||
-- Prevent decay of placed leaves
|
||||
|
||||
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
|
||||
if placer and not placer:get_player_control().sneak then
|
||||
if placer and placer:is_player() and not placer:get_player_control().sneak then
|
||||
local node = minetest.get_node(pos)
|
||||
node.param2 = 1
|
||||
minetest.set_node(pos, node)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue