summaryrefslogtreecommitdiff
path: root/pipes.lua
diff options
context:
space:
mode:
authorthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-09-27 17:00:18 +0100
committerthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-09-27 17:01:46 +0100
commit69133818f7283ea3a8b14060b71df769cac9eb48 (patch)
treebd845e76694d2943dcf2bcefb78beeb329bb4af6 /pipes.lua
parentd6dcd51302633e952b023526da0fe33d3759e2f8 (diff)
downloadpipeworks-69133818f7283ea3a8b14060b71df769cac9eb48.tar
pipeworks-69133818f7283ea3a8b14060b71df769cac9eb48.tar.gz
pipeworks-69133818f7283ea3a8b14060b71df769cac9eb48.tar.bz2
pipeworks-69133818f7283ea3a8b14060b71df769cac9eb48.tar.xz
pipeworks-69133818f7283ea3a8b14060b71df769cac9eb48.zip
pipes.lua: split out new flow logic registration and make it respect feature toggles
Diffstat (limited to 'pipes.lua')
-rw-r--r--pipes.lua40
1 files changed, 3 insertions, 37 deletions
diff --git a/pipes.lua b/pipes.lua
index 4b0b102..54dfbd7 100644
--- a/pipes.lua
+++ b/pipes.lua
@@ -191,6 +191,9 @@ table.insert(pipes_full_nodenames,"pipeworks:valve_on_loaded")
table.insert(pipes_full_nodenames,"pipeworks:entry_panel_loaded")
table.insert(pipes_full_nodenames,"pipeworks:flow_sensor_loaded")
+pipeworks.pipes_full_nodenames = pipes_full_nodenames
+pipeworks.pipes_empty_nodenames = pipes_empty_nodenames
+
@@ -235,42 +238,5 @@ minetest.register_abm({
})
-else
-
-
--- run pressure balancing ABM over all water-moving nodes
--- FIXME: DRY principle, get this from elsewhere in the code
-local pump_on = "pipeworks:pump_on"
-local pump_off = "pipeworks:pump_off"
-
-local pipes_all_nodenames = pipes_full_nodenames
-for _, pipe in ipairs(pipes_empty_nodenames) do
- table.insert(pipes_all_nodenames, pipe)
-end
-table.insert(pipes_all_nodenames, pump_off)
-table.insert(pipes_all_nodenames, pump_on)
-
-
-
-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
-})
-
--- absorb water into pumps if it'll fit
-minetest.register_abm({
- nodenames = { pump_on },
- interval = 1,
- chance = 1,
- action = function(pos, node, active_object_count, active_object_count_wider)
- pipeworks.run_pump_intake(pos, node)
- end
-})
-
-
end