summaryrefslogtreecommitdiff
path: root/new_flow_logic
diff options
context:
space:
mode:
authorthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-10-07 22:29:17 +0100
committerthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-10-07 22:29:17 +0100
commitd4346919bcb4d2e0c692448bc0a652d55c0fa2a9 (patch)
tree938ac58d59de3318b4bfac939e2463e505feb251 /new_flow_logic
parent9ab197af2f6e524be920857c0f152aef84546e37 (diff)
downloadpipeworks-d4346919bcb4d2e0c692448bc0a652d55c0fa2a9.tar
pipeworks-d4346919bcb4d2e0c692448bc0a652d55c0fa2a9.tar.gz
pipeworks-d4346919bcb4d2e0c692448bc0a652d55c0fa2a9.tar.bz2
pipeworks-d4346919bcb4d2e0c692448bc0a652d55c0fa2a9.tar.xz
pipeworks-d4346919bcb4d2e0c692448bc0a652d55c0fa2a9.zip
new flow logic: abms.lua: pass initial pressure to run_output() to allow falling-level event detection
Diffstat (limited to 'new_flow_logic')
-rw-r--r--new_flow_logic/abms.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/new_flow_logic/abms.lua b/new_flow_logic/abms.lua
index 99ccbc6..babd14e 100644
--- a/new_flow_logic/abms.lua
+++ b/new_flow_logic/abms.lua
@@ -81,6 +81,7 @@ flowlogic.run = function(pos, node)
-- get the current pressure value.
local nodepressure = get_pressure_access(pos)
local currentpressure = nodepressure.get()
+ local oldpressure = currentpressure
-- if node is an input: run intake phase
local inputdef = pipeworks.flowables.inputs.list[nodename]
@@ -100,6 +101,7 @@ flowlogic.run = function(pos, node)
pos,
node,
currentpressure,
+ oldpressure,
outputdef,
finitemode)
end
@@ -213,7 +215,7 @@ end
-flowlogic.run_output = function(pos, node, currentpressure, outputdef, finitemode)
+flowlogic.run_output = function(pos, node, currentpressure, oldpressure, outputdef, finitemode)
-- processing step for water output devices.
-- takes care of checking a minimum pressure value and updating the resulting pressure level
-- the outputfn is provided the current pressure and returns the pressure "taken".