1
0
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:
DTA7
2017-10-01 15:41:58 +02:00
committed by paramat
parent 3ae382c913
commit a2d7678ffd
14 changed files with 72 additions and 53 deletions

View File

@ -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