always check for CONTENT_IGNORE around a pipe/tube before converting it
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Wed, 1 Jan 2014 17:26:33 +0000 (12:26 -0500)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Wed, 1 Jan 2014 17:26:33 +0000 (12:26 -0500)
pipes.lua
tubes.lua

index 953bd55cd6ae0268b2b4df30b21c95f31d671e49..20f770baeef89ae87f74a15b59b9048041c1e012 100644 (file)
--- a/pipes.lua
+++ b/pipes.lua
@@ -152,7 +152,11 @@ if REGISTER_COMPATIBILITY then
                interval = 1,
                chance = 1,
                action = function(pos, node, active_object_count, active_object_count_wider)
-                       pipeworks.scan_for_pipe_objects(pos)
+                       local minp = {x = pos.x-1, y = pos.y-1, z = pos.z-1}
+                       local maxp = {x = pos.x+1, y = pos.y+1, z = pos.z+1}
+                       if table.getn(minetest.find_nodes_in_area(minp, maxp, "ignore")) == 0 then
+                               pipeworks.scan_for_pipe_objects(pos)
+                       end
                end
        })
 end
index c397b139be52097cc11835171981a8e8ac996a30..06cef17edf4013aaf250ff53de54a15e29150909 100644 (file)
--- a/tubes.lua
+++ b/tubes.lua
@@ -205,7 +205,11 @@ if REGISTER_COMPATIBILITY then
                interval = 1,
                chance = 1,
                action = function(pos, node, active_object_count, active_object_count_wider)
-                       pipeworks.scan_for_tube_objects(pos)
+                       local minp = {x = pos.x-1, y = pos.y-1, z = pos.z-1}
+                       local maxp = {x = pos.x+1, y = pos.y+1, z = pos.z+1}
+                       if table.getn(minetest.find_nodes_in_area(minp, maxp, "ignore")) == 0 then
+                               pipeworks.scan_for_tube_objects(pos)
+                       end
                end
        })
 end