diff options
author | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-01 20:27:30 +0100 |
---|---|---|
committer | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-01 20:27:30 +0100 |
commit | dc13ec619f7e49b0e75f845f8baa0559a8b11936 (patch) | |
tree | bfa91e8e2f4be7229519649a024fb2759cb328ca | |
parent | 9abdeb3d626c702c044d6d621bdea6c43dbd6647 (diff) | |
download | pipeworks-dc13ec619f7e49b0e75f845f8baa0559a8b11936.tar pipeworks-dc13ec619f7e49b0e75f845f8baa0559a8b11936.tar.gz pipeworks-dc13ec619f7e49b0e75f845f8baa0559a8b11936.tar.bz2 pipeworks-dc13ec619f7e49b0e75f845f8baa0559a8b11936.tar.xz pipeworks-dc13ec619f7e49b0e75f845f8baa0559a8b11936.zip |
new flow logic: abms.lua: remove intake limit coercion causing water to be vanished
-rw-r--r-- | new_flow_logic/abms.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/new_flow_logic/abms.lua b/new_flow_logic/abms.lua index 66349e9..afeb3b3 100644 --- a/new_flow_logic/abms.lua +++ b/new_flow_logic/abms.lua @@ -29,6 +29,8 @@ end +--local formatvec = function(vec) local sep="," return "("..tostring(vec.x)..sep..tostring(vec.y)..sep..tostring(vec.z)..")" end + -- new version of liquid check -- accepts a limit parameter to only delete water blocks that the receptacle can accept, -- and returns it so that the receptacle can update it's pressure values. @@ -43,14 +45,13 @@ local check_for_liquids_v2 = function(pos, limit) total = total + 1 end end + --pipeworks.logger("check_for_liquids_v2@"..formatvec(pos).." total "..total) return total end flowlogic.check_for_liquids_v2 = check_for_liquids_v2 ---local formatvec = function(vec) local sep="," return "("..tostring(vec.x)..sep..tostring(vec.y)..sep..tostring(vec.z)..")" end - local label_pressure = "pipeworks.water_pressure" flowlogic.balance_pressure = function(pos, node) -- debuglog("balance_pressure() "..node.name.." at "..pos.x.." "..pos.y.." "..pos.z) @@ -100,8 +101,8 @@ flowlogic.run_input = function(pos, node, maxpressure, intakefn) if intake_limit <= 0 then return end local actual_intake = intakefn(pos, intake_limit) + --pipeworks.logger("run_input@"..formatvec(pos).." oldpressure "..currentpressure.." intake_limit "..intake_limit.." actual_intake "..actual_intake) if actual_intake <= 0 then return end - if actual_intake >= intake_limit then actual_intake = intake_limit end local newpressure = actual_intake + currentpressure -- debuglog("oldpressure "..currentpressure.." intake_limit "..intake_limit.." actual_intake "..actual_intake.." newpressure "..newpressure) |