respect empty and lye_milk_free flags

develop
Myk Taylor 2023-09-03 07:08:57 -07:00
parent 54d7318e0a
commit 3f1eac720f
No known key found for this signature in database
1 changed files with 14 additions and 0 deletions

@ -88,6 +88,20 @@ bool matchesFilters(df::item * item, const df::job_item * job_item, HeatSafety h
if (job_item->flags2.bits.building_material && !item->isBuildMat())
return false;
if ((job_item->flags1.bits.empty || job_item->flags2.bits.lye_milk_free)) {
auto gref = Items::getGeneralRef(item, df::general_ref_type::CONTAINS_ITEM);
if (gref) {
if (job_item->flags1.bits.empty)
return false;
if (auto contained_item = gref->getItem(); contained_item) {
MaterialInfo mi;
mi.decode(contained_item);
if (mi.getToken() != "WATER")
return false;
}
}
}
if (job_item->metal_ore > -1 && !item->isMetalOre(job_item->metal_ore))
return false;