mirror of
https://github.com/minetest/minetest_game.git
synced 2025-06-28 04:40:22 +02:00
Add nil checks for placer
This commit is contained in:
@ -363,7 +363,8 @@ minetest.register_craftitem("carts:cart", {
|
||||
local node = minetest.get_node(under)
|
||||
local udef = minetest.registered_nodes[node.name]
|
||||
if udef and udef.on_rightclick and
|
||||
not (placer and placer:get_player_control().sneak) then
|
||||
not (placer and placer:is_player() and
|
||||
placer:get_player_control().sneak) then
|
||||
return udef.on_rightclick(under, node, placer, itemstack,
|
||||
pointed_thing) or itemstack
|
||||
end
|
||||
|
Reference in New Issue
Block a user