Remove area protection checks (#91)
This commit is contained in:
parent
fad216db52
commit
03c2fa6618
@ -32,15 +32,6 @@ end
|
||||
function travelnet.actions.remove_station(node_info, _, player)
|
||||
local player_name = player:get_player_name()
|
||||
|
||||
-- abort if protected by another mod
|
||||
if minetest.is_protected(node_info.pos, player_name)
|
||||
and not minetest.check_player_privs(player_name, { protection_bypass = true })
|
||||
then
|
||||
minetest.record_protection_violation(node_info.pos, player_name)
|
||||
return false,
|
||||
S("This @1 belongs to @2. You can't remove it.", node_info.props.description, node_info.props.owner_name)
|
||||
end
|
||||
|
||||
-- players with travelnet_remove priv can dig the station
|
||||
if
|
||||
not minetest.get_player_privs(player_name)[travelnet.remove_priv]
|
||||
@ -73,8 +64,8 @@ end
|
||||
|
||||
function travelnet.actions.edit_station(node_info, _, player)
|
||||
local player_name = player:get_player_name()
|
||||
-- abort if protected by another mod
|
||||
if minetest.is_protected(node_info.pos, player_name)
|
||||
-- abort if user isn't owner
|
||||
if node_info.props.owner_name ~= player_name
|
||||
and not minetest.check_player_privs(player_name, { protection_bypass=true })
|
||||
then
|
||||
minetest.record_protection_violation(node_info.pos, player_name)
|
||||
|
@ -43,17 +43,6 @@ return function (node_info, fields, player)
|
||||
)
|
||||
end
|
||||
|
||||
-- abort if protected by another mod
|
||||
if 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)
|
||||
return false, S("This @1 belongs to @2. You can't edit it.",
|
||||
description,
|
||||
tostring(owner_name)
|
||||
)
|
||||
end
|
||||
|
||||
local travelnets = travelnet.get_travelnets(owner_name)
|
||||
local network = travelnets[station_network]
|
||||
if not network then
|
||||
|
@ -59,17 +59,6 @@ return function (node_info, fields, player)
|
||||
)
|
||||
end
|
||||
|
||||
-- abort if protected by another mod
|
||||
if 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)
|
||||
return false, S("This @1 belongs to @2. You can't edit it.",
|
||||
description,
|
||||
tostring(owner_name)
|
||||
)
|
||||
end
|
||||
|
||||
local timestamp = os.time()
|
||||
if owner_name ~= fields.owner_name then
|
||||
if not minetest.get_player_privs(player_name)[travelnet.attach_priv]
|
||||
|
Loading…
x
Reference in New Issue
Block a user