diff options
author | Tim <t4im@users.noreply.github.com> | 2015-03-05 11:14:30 +0100 |
---|---|---|
committer | Tim <t4im@users.noreply.github.com> | 2015-03-11 19:36:41 +0100 |
commit | d167aacf4d2cdcc98914cd05153b81e709e0eaa7 (patch) | |
tree | 5442649cd3416487bfb5e33faa9576884692866f /init.lua | |
parent | 86ee58b17c2ec9ad303116cf76cfac354cf0f484 (diff) |
add ownership/protection handling for device configuration
take any available ownership into account before deciding on area protection
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -57,6 +57,17 @@ function pipeworks.add_node_box(t, b) end end +function pipeworks.may_configure(pos, player) + local name = player:get_player_name() + local meta = minetest.get_meta(pos) + local owner = meta:get_string("owner") + + if owner ~= "" then -- wielders and filters + return owner == name + end + return not minetest.is_protected(pos, name) +end + function pipeworks.node_is_owned(pos, placer) local ownername = false if type(IsPlayerNodeOwner) == "function" then -- node_ownership mod |