From 2b84b4a3da5802b0315a2f9f9d1a536de955befa Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sun, 1 Oct 2017 10:19:14 -0600 Subject: [PATCH] Was only testing controller node for player protection --- class_layout.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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