admin puede romper tiendas vacias de otros

This commit is contained in:
GNU Hacker 2021-12-16 18:47:43 +01:00
parent b7b7db4820
commit 3d21c146b1

@ -145,11 +145,12 @@ core.register_node("emeraldbank:shop", {
on_metadata_inventory_take = check_empty, on_metadata_inventory_take = check_empty,
can_dig = function(pos, player) can_dig = function(pos, player)
local name = player:get_player_name() local pname = player:get_player_name()
local is_admin = core.check_player_privs(pname, {server=true})
local meta = core.get_meta(pos) local meta = core.get_meta(pos)
local owner = meta:get_string("owner") local owner = meta:get_string("owner")
local inv = meta:get_inventory() local inv = meta:get_inventory()
if inv:is_empty("stock") and name == owner then if inv:is_empty("stock") and (pname == owner or is_admin) then
return true return true
end end
end end