| 569 | } |
| 570 | |
| 571 | static void remove_available_clothing() { |
| 572 | MaterialInfo matInfo; |
| 573 | for (auto &item : world->items.other.IN_PLAY) |
| 574 | { // Skip any non-worn owned items |
| 575 | if (Items::getOwner(item) || item->getWear() >= 1) |
| 576 | continue; |
| 577 | // Again, for each item, find if any clothing order matches |
| 578 | for (auto &clothingOrder : clothingOrders) { |
| 579 | if (item->getType() != clothingOrder.itemType || |
| 580 | item->getSubtype() != clothingOrder.item_subtype |
| 581 | ) |
| 582 | continue; |
| 583 | |
| 584 | matInfo.decode(item); |
| 585 | if (!matInfo.matches(clothingOrder.material_category)) |
| 586 | continue; |
| 587 | |
| 588 | clothingOrder.total_needed_per_race[item->getMakerRace()] --; |
| 589 | } |
| 590 | } |
| 591 | } |
| 592 | |
| 593 | static void add_clothing_orders() { |
| 594 | for (auto &clothingOrder : clothingOrders) { |
no test coverage detected