Fix for eventful and a advfort not to show worn items.

develop
Warmist 2013-03-09 12:54:07 +02:00
parent 5be2ecb080
commit 3ed5f06f49
2 changed files with 7 additions and 3 deletions

@ -60,7 +60,7 @@ struct ProductInfo {
MaterialSource material;
bool isValid() {
return (material.mat_type >= 0 || material.reagent);
return true;//due to mat_type being -1 = any
}
};

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