Doors: Fix trapdoor crash on can_dig with nil-player (e.g. minetest.dig_node)

This commit is contained in:
Tim 2016-07-08 00:51:54 +02:00 committed by paramat
parent f1f96dbe6b
commit fcceec0e8c

View File

@ -543,8 +543,8 @@ function doors.register_trapdoor(name, def)
return true
end
local meta = minetest.get_meta(pos)
local pn = player:get_player_name()
return meta:get_string("doors_owner") == pn
local player_name = player and player:get_player_name()
return meta:get_string("doors_owner") == player_name
end
def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)