Skip to content

Commit

Permalink
Skip distribution if a filter part of an ALL filterset (X+Y+Z) was no…
Browse files Browse the repository at this point in the history
…t found
  • Loading branch information
powerof3 committed Sep 27, 2023
1 parent 0446761 commit 57ffb0d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions SPID/include/FormData.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace Forms
}
}

inline bool formID_to_form(RE::TESDataHandler* a_dataHandler, RawFormVec& a_rawFormVec, FormVec& a_formVec, const std::string& a_path)
inline bool formID_to_form(RE::TESDataHandler* a_dataHandler, RawFormVec& a_rawFormVec, FormVec& a_formVec, const std::string& a_path, bool a_all = false)
{
if (a_rawFormVec.empty()) {
return true;
Expand All @@ -42,7 +42,7 @@ namespace Forms
}
if (modName && !formID) {
if (const RE::TESFile* filterMod = a_dataHandler->LookupModByName(*modName); filterMod) {
a_formVec.push_back(filterMod);
a_formVec.emplace_back(filterMod);
} else {
buffered_logger::error("\t\t[{}] Filter ({}) SKIP - mod cannot be found", a_path, *modName);
}
Expand All @@ -52,7 +52,7 @@ namespace Forms
RE::TESForm::LookupByID(*formID)) {
const auto formType = filterForm->GetFormType();
if (Cache::FormType::GetWhitelisted(formType)) {
a_formVec.push_back(filterForm);
a_formVec.emplace_back(filterForm);
} else {
buffered_logger::error("\t\t[{}] Filter [0x{:X}] ({}) SKIP - invalid formtype ({})", a_path, *formID, modName.value_or(""), formType);
}
Expand All @@ -65,7 +65,7 @@ namespace Forms
if (auto filterForm = RE::TESForm::LookupByEditorID(editorID); filterForm) {
const auto formType = filterForm->GetFormType();
if (Cache::FormType::GetWhitelisted(formType)) {
a_formVec.push_back(filterForm);
a_formVec.emplace_back(filterForm);
} else {
buffered_logger::error("\t\t[{}] Filter ({}) SKIP - invalid formtype ({})", a_path, editorID, formType);
}
Expand All @@ -75,7 +75,7 @@ namespace Forms
}
}
}
return !a_formVec.empty();
return !a_all && !a_formVec.empty() || a_formVec.size() == a_rawFormVec.size();
}
}

Expand Down Expand Up @@ -304,7 +304,7 @@ void Forms::Distributables<Form>::LookupForms(RE::TESDataHandler* a_dataHandler,

FormFilters filterForms{};

bool validEntry = detail::formID_to_form(a_dataHandler, filterIDs.ALL, filterForms.ALL, path);
bool validEntry = detail::formID_to_form(a_dataHandler, filterIDs.ALL, filterForms.ALL, path, true);
if (validEntry) {
validEntry = detail::formID_to_form(a_dataHandler, filterIDs.NOT, filterForms.NOT, path);
}
Expand Down

0 comments on commit 57ffb0d

Please sign in to comment.