Codechange: [Script] Use ScriptList::FillList() in more locations (#11762)

This commit is contained in:
Loïc Guilloux
2024-01-12 21:19:08 +01:00
committed by GitHub
parent 60da6b992e
commit 54b57fbfeb
4 changed files with 19 additions and 17 deletions

View File

@@ -19,9 +19,7 @@ ScriptStoryPageList::ScriptStoryPageList(ScriptCompany::CompanyID company)
uint8_t c = company;
if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY;
for (StoryPage *p : StoryPage::Iterate()) {
if (p->company == c || p->company == INVALID_COMPANY) {
this->AddItem(p->index);
}
}
ScriptList::FillList<StoryPage>(this,
[c](const StoryPage *p) {return p->company == c || p->company == INVALID_COMPANY; }
);
}