Skip to content

Commit

Permalink
Remove area protection checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklp09 committed Jul 13, 2024
1 parent fad216d commit 3c39e64
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
13 changes: 2 additions & 11 deletions actions/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions actions/update_elevator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions actions/update_travelnet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 3c39e64

Please sign in to comment.