summaryrefslogtreecommitdiff
path: root/flowing_logic.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-15 02:53:10 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-15 02:53:10 -0500
commitbd80f18cfce1fb69e78f7d5ce63e7264718378e7 (patch)
tree5eb36d4656efe3de30db472dd7793f9985ba8af8 /flowing_logic.lua
parentb43a1036cae2fda49453a2c0a97b9ed2f6d16023 (diff)
downloadpipeworks-bd80f18cfce1fb69e78f7d5ce63e7264718378e7.tar
pipeworks-bd80f18cfce1fb69e78f7d5ce63e7264718378e7.tar.gz
pipeworks-bd80f18cfce1fb69e78f7d5ce63e7264718378e7.tar.bz2
pipeworks-bd80f18cfce1fb69e78f7d5ce63e7264718378e7.tar.xz
pipeworks-bd80f18cfce1fb69e78f7d5ce63e7264718378e7.zip
local-ize pretty muchg everything that was previously global except where
stuff needs to be globally-visible. Also, fix a bad drop on valve.
Diffstat (limited to 'flowing_logic.lua')
-rw-r--r--flowing_logic.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/flowing_logic.lua b/flowing_logic.lua
index 14af75a..6b5d30f 100644
--- a/flowing_logic.lua
+++ b/flowing_logic.lua
@@ -6,7 +6,7 @@
local finitewater = minetest.setting_getbool("liquid_finite")
-pipeworks_check_for_liquids = function(pos)
+pipeworks.check_for_liquids = function(pos)
local coords = {
{x=pos.x,y=pos.y-1,z=pos.z},
{x=pos.x,y=pos.y+1,z=pos.z},
@@ -24,7 +24,7 @@ pipeworks_check_for_liquids = function(pos)
return false
end
-pipeworks_check_for_inflows = function(pos,node)
+pipeworks.check_for_inflows = function(pos,node)
local coords = {
{x=pos.x,y=pos.y-1,z=pos.z},
{x=pos.x,y=pos.y+1,z=pos.z},
@@ -37,7 +37,7 @@ pipeworks_check_for_inflows = function(pos,node)
for i =1,6 do
if newnode then break end
local name = minetest.get_node(coords[i]).name
- if name and (name == "pipeworks:pump_on" and pipeworks_check_for_liquids(coords[i])) or string.find(name,"_loaded") then
+ if name and (name == "pipeworks:pump_on" and pipeworks.check_for_liquids(coords[i])) or string.find(name,"_loaded") then
if string.find(name,"_loaded") then
local source = minetest.get_meta(coords[i]):get_string("source")
if source == minetest.pos_to_string(pos) then break end
@@ -52,12 +52,12 @@ pipeworks_check_for_inflows = function(pos,node)
end
end
-pipeworks_check_sources = function(pos,node)
+pipeworks.check_sources = function(pos,node)
local sourcepos = minetest.string_to_pos(minetest.get_meta(pos):get_string("source"))
if not sourcepos then return end
local source = minetest.get_node(sourcepos).name
local newnode = false
- if source and not ((source == "pipeworks:pump_on" and pipeworks_check_for_liquids(sourcepos)) or string.find(source,"_loaded") or source == "ignore" ) then
+ if source and not ((source == "pipeworks:pump_on" and pipeworks.check_for_liquids(sourcepos)) or string.find(source,"_loaded") or source == "ignore" ) then
newnode = string.gsub(node.name,"loaded","empty")
end
@@ -67,7 +67,7 @@ pipeworks_check_sources = function(pos,node)
end
end
-pipeworks_spigot_check = function(pos, node)
+pipeworks.spigot_check = function(pos, node)
local belowname = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name
if belowname and (belowname == "air" or belowname == "default:water_flowing" or belowname == "default:water_source") then
local spigotname = minetest.get_node(pos).name
@@ -97,7 +97,7 @@ pipeworks_spigot_check = function(pos, node)
end
end
-pipeworks_fountainhead_check = function(pos, node)
+pipeworks.fountainhead_check = function(pos, node)
local abovename = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name
if abovename and (abovename == "air" or abovename == "default:water_flowing" or abovename == "default:water_source") then
local fountainhead_name = minetest.get_node(pos).name