From 0f8f2bc6f769dd8c4952e56a9a79e3f59e3f89f0 Mon Sep 17 00:00:00 2001 From: Milan2018 Date: Sun, 15 Mar 2020 14:27:03 +0100 Subject: [PATCH] =?UTF-8?q?Zm=C4=9Bnit=20"protector/init.lua"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protector/init.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/protector/init.lua b/protector/init.lua index c9dd9d2..3a1d622 100644 --- a/protector/init.lua +++ b/protector/init.lua @@ -180,7 +180,7 @@ end -- 2 for "This area is owned by . -- 3 for checking protector overlaps -protector.can_dig = function(r, pos, digger, onlyowner, infolevel) +protector.can_dig = function(r, pos, digger, onlyowner, infolevel, mvps) if not digger or not pos then return false @@ -223,7 +223,7 @@ protector.can_dig = function(r, pos, digger, onlyowner, infolevel) if infolevel == 1 and owner ~= digger then -- and you aren't on the member list - if onlyowner or not is_member(meta, digger) then + if onlyowner or not is_member(meta, digger) or digger == "mvps" and not mvps then minetest.chat_send_player(digger, S("This area is owned by @1", owner) .. "!") @@ -679,6 +679,13 @@ if minetest.get_modpath("mesecons_mvps") then mesecon.register_mvps_stopper("protector:protect") mesecon.register_mvps_stopper("protector:protect2") mesecon.register_mvps_stopper("protector:chest") + local old = mesecon.mvps_is_protected + function mesecon.mvps_is_protected(pos, ...) + if not protector.can_dig(protector_radius, pos, "mvps", false, 1, true) then + return true + end + return old(pos, ...) + end end