diff options
Diffstat (limited to 'src/story.cpp')
-rw-r--r-- | src/story.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/story.cpp b/src/story.cpp index 86fd059dd..0d465fde8 100644 --- a/src/story.cpp +++ b/src/story.cpp @@ -157,8 +157,7 @@ CommandCost CmdCreateStoryPageElement(TileIndex tile, DoCommandFlag flags, uint3 /* Allow at most 128 elements per page. */ uint16 element_count = 0; - StoryPageElement *iter; - FOR_ALL_STORY_PAGE_ELEMENTS(iter) { + for (StoryPageElement *iter : StoryPageElement::Iterate()) { if (iter->page == page_id) element_count++; } if (element_count >= 128) return CMD_ERROR; @@ -317,8 +316,7 @@ CommandCost CmdRemoveStoryPage(TileIndex tile, DoCommandFlag flags, uint32 p1, u if (flags & DC_EXEC) { StoryPage *p = StoryPage::Get(page_id); - StoryPageElement *pe; - FOR_ALL_STORY_PAGE_ELEMENTS(pe) { + for (StoryPageElement *pe : StoryPageElement::Iterate()) { if (pe->page == p->index) { delete pe; } |