diff options
author | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-09-27 16:32:22 +0100 |
---|---|---|
committer | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-09-27 16:32:22 +0100 |
commit | c3708b154c8b81d4ec65cbf736f55864519ef01f (patch) | |
tree | 5ac0633a45675ae7d0dfad16ec22d7f4da990f0b | |
parent | 67350b55bb00a8787ebfa3e5ab6763748cfd792d (diff) | |
download | pipeworks-c3708b154c8b81d4ec65cbf736f55864519ef01f.tar pipeworks-c3708b154c8b81d4ec65cbf736f55864519ef01f.tar.gz pipeworks-c3708b154c8b81d4ec65cbf736f55864519ef01f.tar.bz2 pipeworks-c3708b154c8b81d4ec65cbf736f55864519ef01f.tar.xz pipeworks-c3708b154c8b81d4ec65cbf736f55864519ef01f.zip |
flowing_logic.lua: fix pressure limit bug due to accessing non-existant variable
-rw-r--r-- | flowing_logic.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/flowing_logic.lua b/flowing_logic.lua index 0147283..62d75ab 100644 --- a/flowing_logic.lua +++ b/flowing_logic.lua @@ -159,6 +159,10 @@ end +-- local debuglog = function(msg) print("## "..msg) 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. @@ -217,13 +221,16 @@ pipeworks.balance_pressure = function(pos, node) end end + + pipeworks.run_pump_intake = function(pos, node) -- try to absorb nearby water nodes, but only up to limit. -- NB: check_for_liquids_v2 handles zero or negative from the following subtraction local meta = minetest.get_meta(pos) local currentpressure = meta:get_float(label_pressure) local intake_limit = thresholds.pump_pressure - currentpressure - local actual_intake = pipeworks.check_for_liquids_v2(pos, limit) + local actual_intake = pipeworks.check_for_liquids_v2(pos, intake_limit) local newpressure = actual_intake + currentpressure + -- debuglog("oldpressure "..currentpressure.." intake_limit "..intake_limit.." actual_intake "..actual_intake.." newpressure "..newpressure) meta:set_float(label_pressure, newpressure) end |