summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaliy <numzer0@yandex.ru>2020-08-15 15:33:11 +0300
committerGitHub <noreply@github.com>2020-08-15 15:33:11 +0300
commit4750925eab62bc0f3513579be25ded407fecb049 (patch)
tree0b7f3e9f257430ade475afcb0cc6f6b824b97302
parent16836b16d690e2d337575afe9fde286f32ec5d5f (diff)
downloadmesecons-4750925eab62bc0f3513579be25ded407fecb049.tar
mesecons-4750925eab62bc0f3513579be25ded407fecb049.tar.gz
mesecons-4750925eab62bc0f3513579be25ded407fecb049.tar.bz2
mesecons-4750925eab62bc0f3513579be25ded407fecb049.tar.xz
mesecons-4750925eab62bc0f3513579be25ded407fecb049.zip
Allow admins digging any command block (#525)
Allow admins (i.e. players with the `protection_bypass` privilege) digging any command block
-rw-r--r--mesecons_commandblock/init.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesecons_commandblock/init.lua b/mesecons_commandblock/init.lua
index e41c098..f68ac4a 100644
--- a/mesecons_commandblock/init.lua
+++ b/mesecons_commandblock/init.lua
@@ -174,7 +174,8 @@ end
local function can_dig(pos, player)
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
- return owner == "" or owner == player:get_player_name()
+ return owner == "" or owner == player:get_player_name() or
+ minetest.check_player_privs(player, "protection_bypass")
end
minetest.register_node("mesecons_commandblock:commandblock_off", {