summaryrefslogtreecommitdiff
path: root/autoplace_tubes.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-15 04:35:59 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-15 04:35:59 -0500
commit659b4e42b2bb6b55a4031554664b6f371f903f5e (patch)
treedf7d7cbbf3b9d19573e144c7d94a1cb9a6210861 /autoplace_tubes.lua
parentbd80f18cfce1fb69e78f7d5ce63e7264718378e7 (diff)
downloadpipeworks-659b4e42b2bb6b55a4031554664b6f371f903f5e.tar
pipeworks-659b4e42b2bb6b55a4031554664b6f371f903f5e.tar.gz
pipeworks-659b4e42b2bb6b55a4031554664b6f371f903f5e.tar.bz2
pipeworks-659b4e42b2bb6b55a4031554664b6f371f903f5e.tar.xz
pipeworks-659b4e42b2bb6b55a4031554664b6f371f903f5e.zip
local-ize a few more variables, move all of the nodebox models
into their own file and confine them and pretty much everything else to the pipeworks.{} table (still global though). More to come.
Diffstat (limited to 'autoplace_tubes.lua')
-rw-r--r--autoplace_tubes.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/autoplace_tubes.lua b/autoplace_tubes.lua
index 72d1835..cbca2ba 100644
--- a/autoplace_tubes.lua
+++ b/autoplace_tubes.lua
@@ -120,18 +120,18 @@ function tube_autoroute(pos)
-- all sides checked, now figure which tube to use.
- nsurround = ""
- for i,n in ipairs(active) do
- nsurround = nsurround .. n
- end
- local newname=string.sub(nctr.name,1,-7)..nsurround
- if newname == nctr.name then return end
- local meta=minetest.get_meta(pos)
- local meta0=meta:to_table() -- XXX: hacky_swap_node
- nctr.name = newname
- minetest.add_node(pos, nctr)
- local meta=minetest.get_meta(pos)
- meta:from_table(meta0)
+ local nsurround = ""
+ for i,n in ipairs(active) do
+ nsurround = nsurround .. n
+ end
+ local newname=string.sub(nctr.name,1,-7)..nsurround
+ if newname == nctr.name then return end
+ local meta=minetest.get_meta(pos)
+ local meta0=meta:to_table() -- XXX: hacky_swap_node
+ nctr.name = newname
+ minetest.add_node(pos, nctr)
+ local meta=minetest.get_meta(pos)
+ meta:from_table(meta0)
local nctr = minetest.get_node(pos)
end