Suppress checking the cookable material flag if the item is a container.

develop
Alexander Gavrilov 2012-10-20 21:16:00 +04:00
parent 0c9f1e0af4
commit fbba4caab2
1 changed files with 8 additions and 2 deletions

@ -279,11 +279,11 @@ bool ItemTypeInfo::matches(const df::job_item &item, MaterialInfo *mat, bool ski
if (!skip_vector && !matches(item.vector_id)) if (!skip_vector && !matches(item.vector_id))
return false; return false;
df::job_item_flags1 ok1, mask1, item_ok1, item_mask1; df::job_item_flags1 ok1, mask1, item_ok1, item_mask1, xmask1;
df::job_item_flags2 ok2, mask2, item_ok2, item_mask2, xmask2; df::job_item_flags2 ok2, mask2, item_ok2, item_mask2, xmask2;
df::job_item_flags3 ok3, mask3, item_ok3, item_mask3; df::job_item_flags3 ok3, mask3, item_ok3, item_mask3;
ok1.whole = mask1.whole = item_ok1.whole = item_mask1.whole = 0; ok1.whole = mask1.whole = item_ok1.whole = item_mask1.whole = xmask1.whole = 0;
ok2.whole = mask2.whole = item_ok2.whole = item_mask2.whole = xmask2.whole = 0; ok2.whole = mask2.whole = item_ok2.whole = item_mask2.whole = xmask2.whole = 0;
ok3.whole = mask3.whole = item_ok3.whole = item_mask3.whole = 0; ok3.whole = mask3.whole = item_ok3.whole = item_mask3.whole = 0;
@ -362,11 +362,13 @@ bool ItemTypeInfo::matches(const df::job_item &item, MaterialInfo *mat, bool ski
case CAGE: case CAGE:
OK(1,milk); OK(1,milk);
OK(1,milkable); OK(1,milkable);
xmask1.bits.cookable = true;
break; break;
case BUCKET: case BUCKET:
case FLASK: case FLASK:
OK(1,milk); OK(1,milk);
xmask1.bits.cookable = true;
break; break;
case TOOL: case TOOL:
@ -374,6 +376,7 @@ bool ItemTypeInfo::matches(const df::job_item &item, MaterialInfo *mat, bool ski
OK(1,milk); OK(1,milk);
OK(2,lye_milk_free); OK(2,lye_milk_free);
OK(2,blunt); OK(2,blunt);
xmask1.bits.cookable = true;
if (VIRTUAL_CAST_VAR(def, df::itemdef_toolst, custom)) { if (VIRTUAL_CAST_VAR(def, df::itemdef_toolst, custom)) {
df::tool_uses key(tool_uses::FOOD_STORAGE); df::tool_uses key(tool_uses::FOOD_STORAGE);
@ -389,11 +392,13 @@ bool ItemTypeInfo::matches(const df::job_item &item, MaterialInfo *mat, bool ski
OK(1,milk); OK(1,milk);
OK(2,lye_milk_free); OK(2,lye_milk_free);
OK(3,food_storage); OK(3,food_storage);
xmask1.bits.cookable = true;
break; break;
case BOX: case BOX:
OK(1,bag); OK(1,sand_bearing); OK(1,milk); OK(1,bag); OK(1,sand_bearing); OK(1,milk);
OK(2,dye); OK(2,plaster_containing); OK(2,dye); OK(2,plaster_containing);
xmask1.bits.cookable = true;
break; break;
case BIN: case BIN:
@ -460,6 +465,7 @@ bool ItemTypeInfo::matches(const df::job_item &item, MaterialInfo *mat, bool ski
#undef OK #undef OK
#undef RQ #undef RQ
mask1.whole &= ~xmask1.whole;
mask2.whole &= ~xmask2.whole; mask2.whole &= ~xmask2.whole;
return bits_match(item.flags1.whole, ok1.whole, mask1.whole) && return bits_match(item.flags1.whole, ok1.whole, mask1.whole) &&