| 445 | } bad_flags; |
| 446 | |
| 447 | static void scan_item(color_ostream &out, df::item *item, StockProcessor &processor) { |
| 448 | DEBUG(cycle,out).print("scan_item [{}] item_id={}\n", processor.name, item->id); |
| 449 | |
| 450 | if (DBG_NAME(cycle).isEnabled(DebugCategory::LTRACE)) { |
| 451 | string name = ""; |
| 452 | item->getItemDescription(&name, 0); |
| 453 | TRACE(cycle,out).print("item: {}\n", name); |
| 454 | } |
| 455 | |
| 456 | if (processor.is_designated(out, item)) { |
| 457 | TRACE(cycle,out).print("already designated\n"); |
| 458 | ++processor.stats.designated_counts[processor.stockpile_number]; |
| 459 | return; |
| 460 | } |
| 461 | |
| 462 | if (!processor.can_designate(out, item)) { |
| 463 | TRACE(cycle,out).print("cannot designate\n"); |
| 464 | return; |
| 465 | } |
| 466 | |
| 467 | if (!processor.enabled) { |
| 468 | ++processor.stats.can_designate_counts[processor.stockpile_number]; |
| 469 | return; |
| 470 | } |
| 471 | |
| 472 | processor.designate(out, item); |
| 473 | ++processor.stats.newly_designated; |
| 474 | ++processor.stats.designated_counts[processor.stockpile_number]; |
| 475 | } |
| 476 | |
| 477 | // quick check for type. this is intended to catch the case of newly empty storage item |
| 478 | // that happens to still be on the stockpile. we can do a more careful check (e.g. including |
no test coverage detected