diff --git a/SPID/include/FormData.h b/SPID/include/FormData.h index ed4c0ac..4f75d16 100644 --- a/SPID/include/FormData.h +++ b/SPID/include/FormData.h @@ -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; @@ -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); } @@ -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); } @@ -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); } @@ -75,7 +75,7 @@ namespace Forms } } } - return !a_formVec.empty(); + return !a_all && !a_formVec.empty() || a_formVec.size() == a_rawFormVec.size(); } } @@ -304,7 +304,7 @@ void Forms::Distributables