1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-30 05:40:24 +02:00

Add nil checks for placer

This commit is contained in:
DTA7
2017-10-01 15:41:58 +02:00
committed by sfan5
parent ca3e807d35
commit 0216fa08ec
14 changed files with 72 additions and 53 deletions

View File

@ -367,7 +367,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