summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-01-14 19:55:41 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-01-14 19:55:41 -0500
commit4e1ac10a5ae0d61af3c3d137c13cdd29b76e6754 (patch)
treed5e526a5d9625acc0c57001855331ddc21499ef6
parent315f9dee59d5f68a1860a152e308ca3abb151514 (diff)
downloadpipeworks-4e1ac10a5ae0d61af3c3d137c13cdd29b76e6754.tar
pipeworks-4e1ac10a5ae0d61af3c3d137c13cdd29b76e6754.tar.gz
pipeworks-4e1ac10a5ae0d61af3c3d137c13cdd29b76e6754.tar.bz2
pipeworks-4e1ac10a5ae0d61af3c3d137c13cdd29b76e6754.tar.xz
pipeworks-4e1ac10a5ae0d61af3c3d137c13cdd29b76e6754.zip
forgot to account for facedir in spigots when I added that water stream
-rw-r--r--flowing_logic.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/flowing_logic.lua b/flowing_logic.lua
index dffdabf..ea5b09e 100644
--- a/flowing_logic.lua
+++ b/flowing_logic.lua
@@ -74,15 +74,16 @@ local update_outlet = function(pos)
end
local spigot_check = function(pos,node)
+ local fdir=node.param2
local check = {{x=pos.x,y=pos.y,z=pos.z+1},{x=pos.x+1,y=pos.y,z=pos.z},{x=pos.x,y=pos.y,z=pos.z-1},{x=pos.x-1,y=pos.y,z=pos.z} }
- dbg(node.param2..' checking '..minetest.pos_to_string(check[node.param2+1])..' for spigot at '..minetest.pos_to_string(pos))
- local top = minetest.env:get_node(check[node.param2+1]).name
+ dbg(fdir..' checking '..minetest.pos_to_string(check[fdir+1])..' for spigot at '..minetest.pos_to_string(pos))
+ local top = minetest.env:get_node(check[fdir+1]).name
dbg('found '..top)
if string.find(top,'_loaded') then
- minetest.env:add_node({x=pos.x,y=pos.y,z=pos.z},{name='pipeworks:spigot_pouring'})
+ minetest.env:add_node({x=pos.x,y=pos.y,z=pos.z},{name='pipeworks:spigot_pouring', param2 = fdir})
minetest.env:add_node({x=pos.x,y=pos.y-1,z=pos.z},{name='default:water_source'})
elseif minetest.env:get_node({x=pos.x,y=pos.y-1,z=pos.z}).name == 'default:water_source' then
- minetest.env:add_node({x=pos.x,y=pos.y,z=pos.z},{name='pipeworks:spigot'})
+ minetest.env:add_node({x=pos.x,y=pos.y,z=pos.z},{name='pipeworks:spigot', param2 = fdir})
minetest.env:remove_node({x=pos.x,y=pos.y-1,z=pos.z})
end
end