Use new safe privilege function (#4)

The new behavior is equal to the locked chests.
master
Thomas--S 2016-10-24 06:15:39 +02:00 committed by Auke Kok
parent 9fe76c6243
commit 9623dca902
1 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,14 @@ function default.get_safe_formspec(pos)
end
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
end
return true