From 07e769d1b92661dc21bf85dee2f788f929fc444e Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sat, 7 Oct 2017 22:07:30 +0100 Subject: [PATCH] new flow logic: abms.lua: pass finite mod flag to output handler callbacks in flowlogic.run_output() --- new_flow_logic/abms.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/new_flow_logic/abms.lua b/new_flow_logic/abms.lua index 1605ea3..a4d5fc3 100644 --- a/new_flow_logic/abms.lua +++ b/new_flow_logic/abms.lua @@ -173,7 +173,7 @@ end -- this is a constructor function, returning another function which satisfies the output helper requirements. -- note that this does *not* take rotation into account. flowlogic.helpers.make_neighbour_output_fixed = function(neighbours) - return function(pos, node, currentpressure) + return function(pos, node, currentpressure, finitemode) local taken = 0 for _, offset in pairs(neighbours) do local npos = vector.add(pos, offset) @@ -214,7 +214,7 @@ flowlogic.run_output = function(pos, node, currentpressure, outputdef, finitemod local lower = outputdef.lower local result = currentpressure if currentpressure > lower then - local takenpressure = outputdef.outputfn(pos, node, currentpressure) + local takenpressure = outputdef.outputfn(pos, node, currentpressure, finitemode) local newpressure = currentpressure - takenpressure if newpressure < 0 then newpressure = 0 end result = newpressure