mirror of
https://codeberg.org/usrib/emeraldbank.git
synced 2024-08-19 04:44:05 +02:00
admin puede romper tiendas vacias de otros
This commit is contained in:
parent
b7b7db4820
commit
3d21c146b1
5
shop.lua
5
shop.lua
@ -145,11 +145,12 @@ core.register_node("emeraldbank:shop", {
|
||||
on_metadata_inventory_take = check_empty,
|
||||
|
||||
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 owner = meta:get_string("owner")
|
||||
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
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user