Add delprotect privilege for overriding protection
parent
d32fc302cc
commit
e9db6f7f77
|
@ -11,6 +11,8 @@
|
||||||
return false
|
return false
|
||||||
end]]
|
end]]
|
||||||
|
|
||||||
|
minetest.register_privilege("delprotect","Delete other's protection by sneaking")
|
||||||
|
|
||||||
protector = {}
|
protector = {}
|
||||||
|
|
||||||
protector.node = "protector:protect"
|
protector.node = "protector:protect"
|
||||||
|
@ -97,6 +99,9 @@ protector.generate_formspec = function (meta)
|
||||||
end
|
end
|
||||||
|
|
||||||
protector.can_dig = function(r,pos,digger,onlyowner)
|
protector.can_dig = function(r,pos,digger,onlyowner)
|
||||||
|
if minetest.get_player_privs(digger:get_player_name()).delprotect
|
||||||
|
and digger:get_player_control().sneak
|
||||||
|
then return true end
|
||||||
local ok=true
|
local ok=true
|
||||||
for ix = pos.x-r,pos.x+r do
|
for ix = pos.x-r,pos.x+r do
|
||||||
for iy = pos.y-r,pos.y+r do
|
for iy = pos.y-r,pos.y+r do
|
||||||
|
|
Loading…
Reference in New Issue