summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-05-10 16:17:47 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-05-10 16:17:47 -0400
commit54a78297bbe9d0d44926bc003b391b2174e3dd6f (patch)
treeb5c836a5c326ffc68c21d6c61b6e0a9e2374eb91
parentb0d92dd358a6339504783fc0022e970b87af70fb (diff)
downloadpipeworks-54a78297bbe9d0d44926bc003b391b2174e3dd6f.tar
pipeworks-54a78297bbe9d0d44926bc003b391b2174e3dd6f.tar.gz
pipeworks-54a78297bbe9d0d44926bc003b391b2174e3dd6f.tar.bz2
pipeworks-54a78297bbe9d0d44926bc003b391b2174e3dd6f.tar.xz
pipeworks-54a78297bbe9d0d44926bc003b391b2174e3dd6f.zip
remove water node at spigot only at the
pouring-->off transition, not repeatedly.
-rw-r--r--flowing_logic.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/flowing_logic.lua b/flowing_logic.lua
index 7503296..2b03ef3 100644
--- a/flowing_logic.lua
+++ b/flowing_logic.lua
@@ -88,11 +88,13 @@ local spigot_check = function(pos,node)
local name = minetest.env:get_node({x=pos.x,y=pos.y-1,z=pos.z}).name
if string.find(top,'_loaded') and (name == 'air' or name == "default:water_source" or name == "default:water_flowing") then
minetest.env:add_node({x=pos.x,y=pos.y-1,z=pos.z},{name='default:water_source'})
- minetest.env:add_node({x=pos.x,y=pos.y,z=pos.z},{name='pipeworks:spigot_pouring', param2 = fdir})
+ minetest.env:add_node(pos,{name='pipeworks:spigot_pouring', param2 = fdir})
else
- minetest.env:add_node({x=pos.x,y=pos.y,z=pos.z},{name='pipeworks:spigot', param2 = fdir})
- if name == 'air' or name == "default:water_source" or name == "default:water_flowing" then
- minetest.env:remove_node({x=pos.x,y=pos.y-1,z=pos.z})
+ if minetest.env:get_node(pos).name == 'pipeworks:spigot_pouring' then
+ minetest.env:add_node({x=pos.x,y=pos.y,z=pos.z},{name='pipeworks:spigot', param2 = fdir})
+ if name == 'air' or name == "default:water_source" or name == "default:water_flowing" then
+ minetest.env:remove_node({x=pos.x,y=pos.y-1,z=pos.z})
+ end
end
end
end