forked from mtcontrib/pipeworks
pipes.lua: place old ABM code registration behind if-guard for new flag
This commit is contained in:
parent
64a5b18e89
commit
59ac978093
3
init.lua
3
init.lua
@ -111,6 +111,9 @@ dofile(pipeworks.modpath.."/filter-injector.lua")
|
|||||||
dofile(pipeworks.modpath.."/trashcan.lua")
|
dofile(pipeworks.modpath.."/trashcan.lua")
|
||||||
dofile(pipeworks.modpath.."/wielder.lua")
|
dofile(pipeworks.modpath.."/wielder.lua")
|
||||||
|
|
||||||
|
-- temporary flag to enable new flowing behaviour
|
||||||
|
pipeworks.enable_new_flow_logic = true
|
||||||
|
|
||||||
if pipeworks.enable_pipes then dofile(pipeworks.modpath.."/pipes.lua") end
|
if pipeworks.enable_pipes then dofile(pipeworks.modpath.."/pipes.lua") end
|
||||||
if pipeworks.enable_teleport_tube then dofile(pipeworks.modpath.."/teleport_tube.lua") end
|
if pipeworks.enable_teleport_tube then dofile(pipeworks.modpath.."/teleport_tube.lua") end
|
||||||
if pipeworks.enable_pipe_devices then dofile(pipeworks.modpath.."/devices.lua") end
|
if pipeworks.enable_pipe_devices then dofile(pipeworks.modpath.."/devices.lua") end
|
||||||
|
14
pipes.lua
14
pipes.lua
@ -191,6 +191,13 @@ table.insert(pipes_full_nodenames,"pipeworks:valve_on_loaded")
|
|||||||
table.insert(pipes_full_nodenames,"pipeworks:entry_panel_loaded")
|
table.insert(pipes_full_nodenames,"pipeworks:entry_panel_loaded")
|
||||||
table.insert(pipes_full_nodenames,"pipeworks:flow_sensor_loaded")
|
table.insert(pipes_full_nodenames,"pipeworks:flow_sensor_loaded")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if not pipeworks.enable_new_flow_logic then
|
||||||
|
-- sorry, no indents... it messes with the patchlogs too much
|
||||||
|
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = pipes_empty_nodenames,
|
nodenames = pipes_empty_nodenames,
|
||||||
interval = 1,
|
interval = 1,
|
||||||
@ -228,6 +235,9 @@ minetest.register_abm({
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
|
||||||
-- run pressure balancing ABM over all water-moving nodes
|
-- run pressure balancing ABM over all water-moving nodes
|
||||||
local pipes_all_nodenames = pipes_full_nodenames
|
local pipes_all_nodenames = pipes_full_nodenames
|
||||||
for _, pipe in ipairs(pipes_empty_nodenames) do
|
for _, pipe in ipairs(pipes_empty_nodenames) do
|
||||||
@ -241,3 +251,7 @@ minetest.register_abm({
|
|||||||
pipeworks.balance_pressure(pos, node)
|
pipeworks.balance_pressure(pos, node)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user