|
|
@ -488,8 +488,10 @@ function getItemsUncollected(job)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return ret
|
|
|
|
return ret
|
|
|
|
end
|
|
|
|
end
|
|
|
|
function AddItem(tbl,item,recurse)
|
|
|
|
function AddItem(tbl,item,recurse,skip_add)
|
|
|
|
|
|
|
|
if not skip_add then
|
|
|
|
table.insert(tbl,item)
|
|
|
|
table.insert(tbl,item)
|
|
|
|
|
|
|
|
end
|
|
|
|
if recurse then
|
|
|
|
if recurse then
|
|
|
|
local subitems=dfhack.items.getContainedItems(item)
|
|
|
|
local subitems=dfhack.items.getContainedItems(item)
|
|
|
|
if subitems~=nil then
|
|
|
|
if subitems~=nil then
|
|
|
@ -518,6 +520,8 @@ function EnumItems(args)
|
|
|
|
for k,v in pairs(args.unit.inventory) do
|
|
|
|
for k,v in pairs(args.unit.inventory) do
|
|
|
|
if args.inv[v.mode] then
|
|
|
|
if args.inv[v.mode] then
|
|
|
|
AddItem(ret,v.item,args.deep)
|
|
|
|
AddItem(ret,v.item,args.deep)
|
|
|
|
|
|
|
|
elseif args.deep then
|
|
|
|
|
|
|
|
AddItem(ret,v.item,args.deep,true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|