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

Function isUnusableBar

plugins/buildingplan/buildingplan_cycle.cpp:86–99  ·  view source on GitHub ↗

as of v50, soap, coal, and ash are no longer valid building materials

Source from the content-addressed store, hash-verified

84
85// as of v50, soap, coal, and ash are no longer valid building materials
86static bool isUnusableBar(color_ostream& out, df::item* item) {
87 if (item->getType() != df::item_type::BAR)
88 return false;
89
90 MaterialInfo minfo(item);
91 string token = minfo.getToken();
92 if (token.starts_with("COAL:") || token == "ASH")
93 return true;
94
95 df::job_item_flags2 ok;
96 df::job_item_flags2 mask;
97 minfo.getMatchBits(ok, mask);
98 return ok.bits.soap;
99}
100
101static bool isInWheelbarrow(color_ostream& out, df::item* item) {
102 auto container = Items::getContainer(item);

Callers 1

itemPassesScreenFunction · 0.85

Calls 3

getTypeMethod · 0.80
getMatchBitsMethod · 0.80
getTokenMethod · 0.45

Tested by

no test coverage detected