Detect incomplete thread and cloth items in workflow.

develop
Alexander Gavrilov 2012-01-27 21:17:50 +04:00
parent 1d7ed14442
commit ef256e1453
2 changed files with 22 additions and 5 deletions

@ -769,10 +769,10 @@ bool Materials::ReadCreatureTypesEx (void)
// body parts
caste.bodypart.empty();
uint32_t sizebp = ca->unknown1.body_parts.size();
uint32_t sizebp = ca->body_info.body_parts.size();
for (uint32_t k = 0; k < sizebp; k++)
{
df::body_part_raw *bp = ca->unknown1.body_parts[k];
df::body_part_raw *bp = ca->body_info.body_parts[k];
t_bodypart part;
part.id = bp->part_code;
part.category = bp->part_name;

@ -1086,9 +1086,25 @@ static void map_job_items(Core *c)
int16_t imattype = item->getActualMaterial();
int32_t imatindex = item->getActualMaterialIndex();
bool is_invalid = false;
// Special handling
if (dry_buckets && itype == item_type::BUCKET && !item->flags.bits.in_job)
switch (itype) {
case item_type::BUCKET:
if (dry_buckets && !item->flags.bits.in_job)
dryBucket(item);
break;
case item_type::THREAD:
if (item->getTotalDimension() < 15000)
is_invalid = true;
break;
case item_type::CLOTH:
if (item->getTotalDimension() < 10000)
is_invalid = true;
break;
}
if (item->flags.bits.melt && !item->flags.bits.owned && !itemBusy(item))
meltable_count++;
@ -1119,7 +1135,8 @@ static void map_job_items(Core *c)
if (!ok)
continue;
if (item->flags.bits.owned ||
if (is_invalid ||
item->flags.bits.owned ||
item->flags.bits.in_chest ||
item->isAssignedToStockpile() ||
itemInRealJob(item) ||