1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-23 07:10:19 +01:00

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 return true
end end
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local pn = player:get_player_name() local player_name = player and player:get_player_name()
return meta:get_string("doors_owner") == pn return meta:get_string("doors_owner") == player_name
end end
def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)