From 0fc267da841097b0e62f4e66302f64558e97c16c Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Fri, 14 Feb 2020 17:40:49 +0100 Subject: [PATCH] controller: Kick off sorting after pipeworks inserted an item (#40) Controllers in unloaded/inactive areas would become jammed otherwise Co-authored-by: BuckarooBanzay <39065740+BuckarooBanzay@users.noreply.github.com> --- lua/controller.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/controller.lua b/lua/controller.lua index 432b019..25d81f8 100644 --- a/lua/controller.lua +++ b/lua/controller.lua @@ -497,7 +497,12 @@ local function register_controller() def.tube = {} def.tube.insert_object = function(pos, node, stack, tubedir) - return core.get_meta(pos):get_inventory():add_item("src", stack) + -- add stack to inventory + local remaining_stack = core.get_meta(pos):get_inventory():add_item("src", stack) + -- kick off controller work + controller_node_timer(pos) + + return remaining_stack end def.tube.can_insert = function(pos, node, stack, tubedir)