From 9748fbdd5e580d54fed40854538d8a689c256417 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Thu, 12 Jan 2017 01:10:14 -0700 Subject: Fix a bug in protection-testing when writing layout images to world --- class_layout.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/class_layout.lua b/class_layout.lua index 85beba3..11ba4d0 100644 --- a/class_layout.lua +++ b/class_layout.lua @@ -309,12 +309,15 @@ end function DigtronLayout.can_write_layout_image(self) for k, node_image in pairs(self.all) do - -- check if the target node is buildable_to or is marked as part of the digtron that's moving - if not self.old_pos_pointset:get(node_image.pos.x, node_image.pos.y, node_image.pos.z) - and not minetest.registered_nodes[minetest.get_node(node_image.pos).name].buildable_to then - return false --check if we're moving into a protected node - elseif self.protected:get(node_image.pos) then + if self.protected:get(node_image.pos.x, node_image.pos.y, node_image.pos.z) then + return false + end + -- check if the target node is buildable_to or is marked as part of the digtron that's moving + if not ( + self.old_pos_pointset:get(node_image.pos.x, node_image.pos.y, node_image.pos.z) + or minetest.registered_nodes[minetest.get_node(node_image.pos).name].buildable_to + ) then return false end end -- cgit v1.2.3