From 3486ee319ee4fafbf83c583dd9fedfaed92db7c4 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 00:44:14 +0100 Subject: abms.lua: refactor and generalise run_pump_intake() to allow passing custom intake functions --- new_flow_logic/abm_register.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'new_flow_logic/abm_register.lua') diff --git a/new_flow_logic/abm_register.lua b/new_flow_logic/abm_register.lua index 505ca4b..57c8a47 100644 --- a/new_flow_logic/abm_register.lua +++ b/new_flow_logic/abm_register.lua @@ -24,13 +24,13 @@ register.balance = register_abm_balance -- register a node for the pump ABM. -- maxpressure is the maximum pressure that this pump can drive. -local register_abm_input = function(nodename, maxpressure) +local register_abm_input = function(nodename, maxpressure, intakefn) minetest.register_abm({ nodenames = { nodename }, interval = 1, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) - pipeworks.flowlogic.run_pump_intake(pos, node, maxpressure) + pipeworks.flowlogic.run_input(pos, node, maxpressure, intakefn) end }) end -- cgit v1.2.3