new_flow_logic/abms.lua: run_pump_intake(): use passed-in maxpressure instead of table lookup, pass through in abm_register.lua

This commit is contained in:
thetaepsilon-gamedev 2017-10-01 00:00:33 +01:00
parent 21892456f5
commit 31741e33e2
2 changed files with 2 additions and 5 deletions

View File

@ -30,7 +30,7 @@ local register_abm_input = function(nodename, maxpressure)
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) 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
}) })
end end

View File

@ -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. -- try to absorb nearby water nodes, but only up to limit.
-- NB: check_for_liquids_v2 handles zero or negative from the following subtraction -- 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 meta = minetest.get_meta(pos)
local currentpressure = meta:get_float(label_pressure) local currentpressure = meta:get_float(label_pressure)