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
local rp = mat.material.reaction_product
local idx = utils.linear_index(rp.id, p_code)
if not idx then
goto continue
end
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
else
if p_code == "SOAP_MAT" then
mat_mask = { soap = true }