Skip to content

Commit

Permalink
Allow listing shared teleport tubes
Browse files Browse the repository at this point in the history
  • Loading branch information
S-S-X committed Jan 5, 2022
1 parent 829143f commit 4175c00
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tubetool/nodes/teleport_tube.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ local definition = {
protection_bypass_read = "interact",
}

function definition:before_info(pos, player)
if metatool.before_info(self, pos, player, true) then
-- Player is allowed to bypass protections or operate in area
return true
end
-- Allow bypass info protection if tube is marked as shared with sharetool
local meta = minetest.get_meta(pos)
return meta:get_int('sharetool_shared_node') == 1
end

function definition:info(node, pos, player)
if not ns.pipeworks_tptube_api_check(player) then return end
local meta = minetest.get_meta(pos)
Expand Down

0 comments on commit 4175c00

Please sign in to comment.