From 68a8555825226c2a3bcba853da0f1f271406ca47 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 12 Feb 2023 21:30:12 +0100 Subject: [PATCH] Fix doser goes blocked bug --- basis/recipe_lib.lua | 2 ++ chemistry/ta4_doser.lua | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/basis/recipe_lib.lua b/basis/recipe_lib.lua index e583c71..fc069b6 100644 --- a/basis/recipe_lib.lua +++ b/basis/recipe_lib.lua @@ -159,8 +159,10 @@ function techage.recipes.on_receive_fields(pos, formname, fields, player) if not nvm.running then if fields.next == ">>" then nvm.recipe_idx = nvm.recipe_idx + 1 + return true elseif fields.priv == "<<" then nvm.recipe_idx = nvm.recipe_idx - 1 + return true end end end diff --git a/chemistry/ta4_doser.lua b/chemistry/ta4_doser.lua index bf9abec..8cb9009 100644 --- a/chemistry/ta4_doser.lua +++ b/chemistry/ta4_doser.lua @@ -113,9 +113,6 @@ local function start_node(pos, nvm, state) reactor_cmnd(pos, "start") del_liquids(pos) nvm.running = true - local mem = techage.get_mem(pos) - mem.waste_leftover = nil - mem.output_leftover = nil end local function stop_node(pos, nvm, state) @@ -275,7 +272,11 @@ local function on_receive_fields(pos, formname, fields, player) local nvm = techage.get_nvm(pos) if not nvm.running then - recipes.on_receive_fields(pos, formname, fields, player) + if recipes.on_receive_fields(pos, formname, fields, player) then + local mem = techage.get_mem(pos) + mem.waste_leftover = nil + mem.output_leftover = nil + end end local mem = techage.get_mem(pos) mem.dbg_cycles = 5