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

Method make_dyes

plugins/tailor.cpp:588–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586 }
587
588 void make_dyes(int count)
589 {
590 auto reaction_produces_dye = [] (df::reaction* r) {
591 return std::ranges::any_of(r->products, product_is_dye);
592 };
593
594 for (auto r : std::ranges::views::filter(world->raws.reactions.reactions, reaction_produces_dye))
595 {
596 int max = get_reaction_max_count(r,1);
597
598 if (max > 0)
599 {
600 max = order_dye_from_reaction(r, max);
601 }
602
603 count = std::max(0, count - max);
604 if (count <= 0)
605 break;
606 }
607 }
608
609 int count_dye_cloth_orders()
610 {

Callers

nothing calls this directly

Calls 1

filterFunction · 0.85

Tested by

no test coverage detected