From 3d21c146b198c896728ec6033f39449b9ebe9ff7 Mon Sep 17 00:00:00 2001 From: GNU Hacker Date: Thu, 16 Dec 2021 18:47:43 +0100 Subject: [PATCH] admin puede romper tiendas vacias de otros --- shop.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shop.lua b/shop.lua index 443af0f..babbc86 100644 --- a/shop.lua +++ b/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