Fix error in material_defs lookups

Changed in dfhack/df-structures@7dfea1f1d4
Fixes #1722
develop
lethosor 2020-12-14 00:03:29 -05:00
parent 9a6dcc3d36
commit 123c207d9c
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 5 additions and 6 deletions

@ -206,17 +206,16 @@ local plant_products = {
}
for job,flag in pairs(plant_products) do
local ttag = 'type_'..string.lower(flag)
local itag = 'idx_'..string.lower(flag)
local tag = string.lower(flag)
job_outputs[job] = function(callback, job)
local mat_type, mat_index = -1, -1
local seed_type, seed_index = -1, -1
local mat = dfhack.matinfo.decode(job.job_items[0])
if mat and mat.plant and mat.plant.flags[flag] then
mat_type = mat.plant.material_defs[ttag]
mat_index = mat.plant.material_defs[itag]
seed_type = mat.plant.material_defs['type_seed']
seed_index = mat.plant.material_defs['idx_seed']
mat_type = mat.plant.material_defs.type[tag]
mat_index = mat.plant.material_defs.idx[tag]
seed_type = mat.plant.material_defs.type.seed
seed_index = mat.plant.material_defs.idx.seed
end
local mat_mask = { }
if flag ~= 'LEAVES' then