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