From f3e357d16195f063a7fbd2a050d13e89e1f2397c Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Tue, 30 Apr 2013 19:42:51 +0400 Subject: [PATCH] Fix detection of GET_MATERIAL_FROM_REAGENT results in workflow. Dereference pointer to strings. Also just return undefined material instead of skipping the product if it still fails. --- plugins/lua/workflow.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/lua/workflow.lua b/plugins/lua/workflow.lua index 563e83297..4326aa5d0 100644 --- a/plugins/lua/workflow.lua +++ b/plugins/lua/workflow.lua @@ -73,11 +73,10 @@ function job_outputs.CustomReaction(callback, job) if mat then local rp = mat.material.reaction_product - local idx = utils.linear_index(rp.id, p_code) - if not idx then - goto continue + local idx = utils.linear_index(rp.id, p_code, 'value') + if idx then + mat_type, mat_index = rp.material.mat_type[idx], rp.material.mat_index[idx] end - mat_type, mat_index = rp.material.mat_type[idx], rp.material.mat_index[idx] else if p_code == "SOAP_MAT" then mat_mask = { soap = true }