Změnit "protector/init.lua"
This commit is contained in:
parent
c28d6f3dc2
commit
0f8f2bc6f7
1 changed files with 9 additions and 2 deletions
|
@ -180,7 +180,7 @@ end
|
||||||
-- 2 for "This area is owned by <owner>.
|
-- 2 for "This area is owned by <owner>.
|
||||||
-- 3 for checking protector overlaps
|
-- 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
|
if not digger or not pos then
|
||||||
return false
|
return false
|
||||||
|
@ -223,7 +223,7 @@ protector.can_dig = function(r, pos, digger, onlyowner, infolevel)
|
||||||
if infolevel == 1 and owner ~= digger then
|
if infolevel == 1 and owner ~= digger then
|
||||||
|
|
||||||
-- and you aren't on the member list
|
-- 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,
|
minetest.chat_send_player(digger,
|
||||||
S("This area is owned by @1", owner) .. "!")
|
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:protect")
|
||||||
mesecon.register_mvps_stopper("protector:protect2")
|
mesecon.register_mvps_stopper("protector:protect2")
|
||||||
mesecon.register_mvps_stopper("protector:chest")
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue