fix items not being filtered correctly in item selection screen

develop
Myk Taylor 2023-03-31 04:45:59 -07:00
parent 0db93762cf
commit 44adae24ab
No known key found for this signature in database
1 changed files with 4 additions and 3 deletions

@ -678,13 +678,14 @@ static int scanAvailableItems(color_ostream &out, df::building_type type, int16_
auto other_id = ENUM_ATTR(job_item_vector_id, other, vector_id); auto other_id = ENUM_ATTR(job_item_vector_id, other, vector_id);
for (auto &item : df::global::world->items.other[other_id]) { for (auto &item : df::global::world->items.other[other_id]) {
ItemFilter filter = filters[index]; ItemFilter filter = filters[index];
if (counts) { set<string> special = specials;
if (ignore_filters || counts) {
// don't filter by material; we want counts for all materials // don't filter by material; we want counts for all materials
filter.setMaterialMask(0); filter.setMaterialMask(0);
filter.setMaterials(set<MaterialInfo>()); filter.setMaterials(set<MaterialInfo>());
special.clear();
} }
if (itemPassesScreen(item) && if (itemPassesScreen(item) && matchesFilters(item, jitem, heat, filter, specials)) {
(ignore_filters || matchesFilters(item, jitem, heat, filter, specials))) {
if (item_ids) if (item_ids)
item_ids->emplace_back(item->id); item_ids->emplace_back(item->id);
if (counts) { if (counts) {