Merge pull request #3135 from myk002/myk_is_such_a_tool

fix items not being filtered correctly in item selection screen
develop
Myk 2023-03-31 04:51:59 -07:00 committed by GitHub
commit 4e96a9d9da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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, special)) {
(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) {