summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-09-27 14:14:33 +0100
committerthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-09-27 14:14:33 +0100
commitf82570f58027ec7659c4050124fdc15d1203dbd8 (patch)
treeb13cec564d93313f9a9c5364071fae6e744655d4
parent2adcd3e777c45d5988ce21d3130fa8f6c6483e53 (diff)
downloadpipeworks-f82570f58027ec7659c4050124fdc15d1203dbd8.tar
pipeworks-f82570f58027ec7659c4050124fdc15d1203dbd8.tar.gz
pipeworks-f82570f58027ec7659c4050124fdc15d1203dbd8.tar.bz2
pipeworks-f82570f58027ec7659c4050124fdc15d1203dbd8.tar.xz
pipeworks-f82570f58027ec7659c4050124fdc15d1203dbd8.zip
initial stub patches to re-implement new_flow_logic
-rw-r--r--flowing_logic.lua8
-rw-r--r--pipes.lua14
2 files changed, 22 insertions, 0 deletions
diff --git a/flowing_logic.lua b/flowing_logic.lua
index 632baa6..0e62b46 100644
--- a/flowing_logic.lua
+++ b/flowing_logic.lua
@@ -132,3 +132,11 @@ pipeworks.fountainhead_check = function(pos, node)
end
end
end
+
+local debuglog = function(msg)
+ print("## pipeworks: "..msg)
+end
+
+pipeworks.balance_pressure = function(pos, node)
+ debuglog("balance_pressure() stub! "..node.name.." at "..pos.x.." "..pos.y.." "..pos.z)
+end
diff --git a/pipes.lua b/pipes.lua
index 9771e3b..5a48801 100644
--- a/pipes.lua
+++ b/pipes.lua
@@ -227,3 +227,17 @@ minetest.register_abm({
end
})
+
+-- run pressure balancing ABM over all water-moving nodes
+local pipes_all_nodenames = pipes_full_nodenames
+for _, pipe in ipairs(pipes_empty_nodenames) do
+ table.insert(pipes_all_nodenames, pipe)
+end
+minetest.register_abm({
+ nodenames = pipes_all_nodenames,
+ interval = 1,
+ chance = 1,
+ action = function(pos, node, active_object_count, active_object_count_wider)
+ pipeworks.balance_pressure(pos, node)
+ end
+})