mirror of
https://github.com/mt-mods/currency.git
synced 2024-11-26 06:13:44 +01:00
Use new safe privilege function (#4)
The new behavior is equal to the locked chests.
This commit is contained in:
parent
9fe76c6243
commit
9623dca902
9
safe.lua
9
safe.lua
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user