forked from mtcontrib/pipeworks
new flow logic: register_local_pipes.lua: make spigots work again
This commit is contained in:
parent
e615a1013b
commit
3a1edac06c
@ -76,7 +76,7 @@ register.output = function(nodename, threshold, outputfn)
|
|||||||
checkbase(nodename)
|
checkbase(nodename)
|
||||||
pipeworks.flowables.outputs.list[nodename] = { threshold=threshold, outputfn=outputfn }
|
pipeworks.flowables.outputs.list[nodename] = { threshold=threshold, outputfn=outputfn }
|
||||||
if pipeworks.enable_new_flow_logic then
|
if pipeworks.enable_new_flow_logic then
|
||||||
abmregister.output(nodename, maxpressure, outputfn)
|
abmregister.output(nodename, threshold, outputfn)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
local thresholds = {}
|
local thresholds = {}
|
||||||
-- limit on pump pressure - will not absorb more than can be taken
|
-- limit on pump pressure - will not absorb more than can be taken
|
||||||
thresholds.pump_pressure = 2
|
thresholds.pump_pressure = 2
|
||||||
|
-- activation threshold for spigot
|
||||||
|
-- should not be below 1, as spigot helper code indiscriminately places a water source node if run.
|
||||||
|
thresholds.spigot_min = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -15,6 +18,7 @@ local pipes_full_nodenames = pipeworks.pipes_full_nodenames
|
|||||||
local pipes_empty_nodenames = pipeworks.pipes_empty_nodenames
|
local pipes_empty_nodenames = pipeworks.pipes_empty_nodenames
|
||||||
|
|
||||||
local register = pipeworks.flowables.register
|
local register = pipeworks.flowables.register
|
||||||
|
local flowlogic = pipeworks.flowlogic
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -40,5 +44,9 @@ if pipeworks.enable_pipes then
|
|||||||
register.simple(spigot_off)
|
register.simple(spigot_off)
|
||||||
|
|
||||||
register.intake_simple(pump_on, thresholds.pump_pressure)
|
register.intake_simple(pump_on, thresholds.pump_pressure)
|
||||||
|
-- TODO: the code doesn't currently care if the spigot is the visually flowing node or not.
|
||||||
|
-- So some mechanism to register on/off states would be nice
|
||||||
|
register.output(spigot_off, thresholds.spigot_min, flowlogic.helpers.output_spigot)
|
||||||
|
register.output(spigot_on, thresholds.spigot_min, flowlogic.helpers.output_spigot)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user