From 31741e33e20c2ed366f80c01c7d6b4a6a23e0d4c Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 00:00:33 +0100 Subject: [PATCH] new_flow_logic/abms.lua: run_pump_intake(): use passed-in maxpressure instead of table lookup, pass through in abm_register.lua --- new_flow_logic/abm_register.lua | 2 +- new_flow_logic/abms.lua | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/new_flow_logic/abm_register.lua b/new_flow_logic/abm_register.lua index e7bed6a..505ca4b 100644 --- a/new_flow_logic/abm_register.lua +++ b/new_flow_logic/abm_register.lua @@ -30,7 +30,7 @@ local register_abm_input = function(nodename, maxpressure) interval = 1, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) - pipeworks.flowlogic.run_pump_intake(pos, node) + pipeworks.flowlogic.run_pump_intake(pos, node, maxpressure) end }) end diff --git a/new_flow_logic/abms.lua b/new_flow_logic/abms.lua index 7360668..ece81c1 100644 --- a/new_flow_logic/abms.lua +++ b/new_flow_logic/abms.lua @@ -89,13 +89,10 @@ end -flowlogic.run_pump_intake = function(pos, node) +flowlogic.run_pump_intake = function(pos, node, maxpressure) -- 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 properties = pipeworks.flowables.inputs.list[node.name] - local maxpressure = properties.maxpressure - local meta = minetest.get_meta(pos) local currentpressure = meta:get_float(label_pressure)