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.
develop
Alexander Gavrilov 2013-04-30 19:42:51 +04:00
parent 18a91ef221
commit f3e357d161
1 changed files with 3 additions and 4 deletions

@ -73,11 +73,10 @@ function job_outputs.CustomReaction(callback, job)
if mat then if mat then
local rp = mat.material.reaction_product local rp = mat.material.reaction_product
local idx = utils.linear_index(rp.id, p_code) local idx = utils.linear_index(rp.id, p_code, 'value')
if not idx then if idx then
goto continue mat_type, mat_index = rp.material.mat_type[idx], rp.material.mat_index[idx]
end end
mat_type, mat_index = rp.material.mat_type[idx], rp.material.mat_index[idx]
else else
if p_code == "SOAP_MAT" then if p_code == "SOAP_MAT" then
mat_mask = { soap = true } mat_mask = { soap = true }