diff options
author | Thomas--S <Thomas--S@users.noreply.github.com> | 2016-10-24 06:15:39 +0200 |
---|---|---|
committer | Auke Kok <sofar+github@foo-projects.org> | 2016-10-23 21:15:39 -0700 |
commit | 9623dca902f48e3aef1353817762e18f09966e20 (patch) | |
tree | 256e44417d8ddb47f639b08e6bda0c0377af2497 | |
parent | 9fe76c6243af94a4d7dedf6264a29d4173fcd2db (diff) | |
download | currency-9623dca902f48e3aef1353817762e18f09966e20.tar.gz currency-9623dca902f48e3aef1353817762e18f09966e20.tar.bz2 currency-9623dca902f48e3aef1353817762e18f09966e20.zip |
Use new safe privilege function (#4)
The new behavior is equal to the locked chests.
-rw-r--r-- | safe.lua | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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
|