summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-01-12 01:10:14 -0700
committerFaceDeer <derksenmobile@gmail.com>2017-01-12 01:10:14 -0700
commit9748fbdd5e580d54fed40854538d8a689c256417 (patch)
treeb47848c0a66304c4057ec2363a636c22db52a8ac
parent578484352b8892787974fe14b0b856579c5f5afe (diff)
Fix a bug in protection-testing when writing layout images to world
-rw-r--r--class_layout.lua13
1 files 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