Was only testing controller node for player protection

This commit is contained in:
FaceDeer 2017-10-01 10:19:14 -06:00
parent 444411936c
commit 2b84b4a3da

@ -94,6 +94,12 @@ function DigtronLayout.create(pos, player)
self.protected:set(testpos.x, testpos.y, testpos.z, true) self.protected:set(testpos.x, testpos.y, testpos.z, true)
end end
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") local group_number = minetest.get_item_group(node.name, "digtron")
if group_number > 0 then if group_number > 0 then
@ -116,7 +122,7 @@ function DigtronLayout.create(pos, player)
table.insert(self.fuelstores, node_image) table.insert(self.fuelstores, node_image)
end 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 self.contains_protected_node = true
end end