diff options
author | FaceDeer <derksenmobile@gmail.com> | 2017-10-01 10:19:14 -0600 |
---|---|---|
committer | FaceDeer <derksenmobile@gmail.com> | 2017-10-01 10:19:14 -0600 |
commit | 2b84b4a3da5802b0315a2f9f9d1a536de955befa (patch) | |
tree | 5cfdad22bf5d50e9e4a783fc97830ea00c0c3c9c | |
parent | 444411936cc85ba0ef9bfaad11f74544c24cb0b6 (diff) |
Was only testing controller node for player protection
-rw-r--r-- | class_layout.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/class_layout.lua b/class_layout.lua index 63ce529..f21519b 100644 --- a/class_layout.lua +++ b/class_layout.lua @@ -94,6 +94,12 @@ function DigtronLayout.create(pos, player) self.protected:set(testpos.x, testpos.y, testpos.z, true) end end + + local is_protected = false + if minetest.is_protected(testpos, player:get_player_name()) and not minetest.check_player_privs(player, "protection_bypass") then + self.protected:set(testpos.x, testpos.y, testpos.z, true) + is_protected = true + end local group_number = minetest.get_item_group(node.name, "digtron") if group_number > 0 then @@ -116,7 +122,7 @@ function DigtronLayout.create(pos, player) table.insert(self.fuelstores, node_image) end - if minetest.is_protected(pos, player:get_player_name()) and not minetest.check_player_privs(player, "protection_bypass") then + if is_protected then self.contains_protected_node = true end |