MCPcopy Create free account
hub / github.com/DFHack/dfhack / remove_available_clothing

Function remove_available_clothing

plugins/autoclothing.cpp:571–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569}
570
571static 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
593static void add_clothing_orders() {
594 for (auto &clothingOrder : clothingOrders) {

Callers 1

do_autoclothingFunction · 0.85

Calls 3

getTypeMethod · 0.80
decodeMethod · 0.45
matchesMethod · 0.45

Tested by

no test coverage detected