Use new safe privilege function (#4)

The new behavior is equal to the locked chests.
This commit is contained in:
Thomas--S 2016-10-24 06:15:39 +02:00 committed by Auke Kok
parent 9fe76c6243
commit 9623dca902

@ -8,7 +8,14 @@ function default.get_safe_formspec(pos)
end end
local function has_safe_privilege(meta, player) local function has_safe_privilege(meta, player)
if not player or player:get_player_name() ~= meta:get_string("owner") then local name = ""
if player then
if minetest.check_player_privs(player, "protection_bypass") then
return true
end
name = player:get_player_name()
end
if name ~= meta:get_string("owner") then
return false return false
end end
return true return true