diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2019-07-14 13:23:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-14 13:23:38 +0200 |
commit | 47492386ece5b016a7a0ed06d6a44cc7d60adb55 (patch) | |
tree | 186d5650989663e4fb1acb801212936eb6d7d468 /builtin/game | |
parent | 0c319469439237ba0db31ccbffeef06e2f5ab45f (diff) | |
download | minetest-47492386ece5b016a7a0ed06d6a44cc7d60adb55.tar.gz minetest-47492386ece5b016a7a0ed06d6a44cc7d60adb55.tar.bz2 minetest-47492386ece5b016a7a0ed06d6a44cc7d60adb55.zip |
Docs: Clarify where to check for 'protection_bypass' (#8675)
Diffstat (limited to 'builtin/game')
-rw-r--r-- | builtin/game/item.lua | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua index ced28771e..7855880f8 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -251,11 +251,6 @@ local function user_name(user) return user and user:get_player_name() or "" end -local function is_protected(pos, name) - return core.is_protected(pos, name) and - not minetest.check_player_privs(name, "protection_bypass") -end - -- Returns a logging function. For empty names, does not log. local function make_log(name) return name ~= "" and core.log or function() end @@ -302,7 +297,7 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2, place_to = {x = under.x, y = under.y, z = under.z} end - if is_protected(place_to, playername) then + if core.is_protected(place_to, playername) then log("action", playername .. " tried to place " .. def.name .. " at protected position " @@ -552,7 +547,7 @@ function core.node_dig(pos, node, digger) return end - if is_protected(pos, diggername) then + if core.is_protected(pos, diggername) then log("action", diggername .. " tried to dig " .. node.name .. " at protected position " |