diff options
author | glx <glx@openttd.org> | 2019-12-17 21:21:33 +0100 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-12-21 20:13:03 +0100 |
commit | 847e5f33d4749568cda696b8940ec10b540bd6fb (patch) | |
tree | 1e61e1586e351722db89f537b9222a50f278abb0 /src/script | |
parent | 869581eb238b820574d64cd8dabc9324cd7a0dd5 (diff) | |
download | openttd-847e5f33d4749568cda696b8940ec10b540bd6fb.tar.xz |
Codechange: Replace story related FOR_ALL with range-based for loops
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/script_storypageelementlist.cpp | 3 | ||||
-rw-r--r-- | src/script/api/script_storypagelist.cpp | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/script/api/script_storypageelementlist.cpp b/src/script/api/script_storypageelementlist.cpp index 5df7dbf0a..ce60963f2 100644 --- a/src/script/api/script_storypageelementlist.cpp +++ b/src/script/api/script_storypageelementlist.cpp @@ -17,8 +17,7 @@ ScriptStoryPageElementList::ScriptStoryPageElementList(ScriptStoryPage::StoryPag { if (!ScriptStoryPage::IsValidStoryPage(story_page_id)) return; - StoryPageElement *pe; - FOR_ALL_STORY_PAGE_ELEMENTS(pe) { + for (StoryPageElement *pe : StoryPageElement::Iterate()) { if (pe->page == story_page_id) { this->AddItem(pe->index); } diff --git a/src/script/api/script_storypagelist.cpp b/src/script/api/script_storypagelist.cpp index fc515472a..63f835ada 100644 --- a/src/script/api/script_storypagelist.cpp +++ b/src/script/api/script_storypagelist.cpp @@ -19,8 +19,7 @@ ScriptStoryPageList::ScriptStoryPageList(ScriptCompany::CompanyID company) uint8 c = company; if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY; - StoryPage *p; - FOR_ALL_STORY_PAGES(p) { + for (StoryPage *p : StoryPage::Iterate()) { if (p->company == c || p->company == INVALID_COMPANY) { this->AddItem(p->index); } |