1

Fixed formlist iteration in RefHasItem

This commit is contained in:
Eddoursul 2022-07-02 18:42:40 +02:00
parent 8039f6315f
commit 324db21c5e
2 changed files with 8 additions and 4 deletions

Binary file not shown.

View File

@ -62,11 +62,15 @@ inline bool RefHasItem(RE::TESForm* a_refOrList, RE::FormID a_formID)
const auto list = a_refOrList->As<RE::BGSListForm>(); const auto list = a_refOrList->As<RE::BGSListForm>();
if (list) { if (list) {
for (const auto& ref : list->forms) { bool bResult = false;
if (ref && RefHasItem(ref, a_formID)) { list->ForEachForm([&](RE::TESForm& a_form) {
return true; if (&a_form && RefHasItem(&a_form, a_formID)) {
bResult = true;
return false;
} }
} return true;
});
return bResult;
} }
return false; return false;