remove unnecessary privilege checks
This commit is contained in:
parent
15b0e749fd
commit
a15ce62b20
@ -190,10 +190,7 @@ end
|
|||||||
|
|
||||||
function workbench.allow_put(pos, listname, index, stack, player)
|
function workbench.allow_put(pos, listname, index, stack, player)
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
if (
|
if minetest.is_protected(pos, player_name) then
|
||||||
minetest.is_protected(pos, player_name) and
|
|
||||||
not minetest.check_player_privs(player_name, {protection_bypass=true})
|
|
||||||
) then
|
|
||||||
minetest.record_protection_violation(pos, player_name)
|
minetest.record_protection_violation(pos, player_name)
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
@ -229,10 +226,7 @@ end
|
|||||||
|
|
||||||
function workbench.allow_move(pos, from_list, from_index, to_list, to_index, count, player)
|
function workbench.allow_move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
if (
|
if minetest.is_protected(pos, player_name) then
|
||||||
minetest.is_protected(pos, player_name) and
|
|
||||||
not minetest.check_player_privs(player_name, {protection_bypass=true})
|
|
||||||
) then
|
|
||||||
minetest.record_protection_violation(pos, player_name)
|
minetest.record_protection_violation(pos, player_name)
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
@ -258,10 +252,7 @@ end
|
|||||||
|
|
||||||
function workbench.allow_take(pos, listname, index, stack, player)
|
function workbench.allow_take(pos, listname, index, stack, player)
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
if (
|
if minetest.is_protected(pos, player_name) then
|
||||||
minetest.is_protected(pos, player_name) and
|
|
||||||
not minetest.check_player_privs(player_name, {protection_bypass=true})
|
|
||||||
) then
|
|
||||||
minetest.record_protection_violation(pos, player_name)
|
minetest.record_protection_violation(pos, player_name)
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user