Fix doser goes blocked bug

This commit is contained in:
Joachim Stolberg 2023-02-12 21:30:12 +01:00
parent 83b2bd483f
commit 68a8555825
2 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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