From ed6fc9dbc77794b7552bc328432e644032110fdc Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 17 Jul 2019 22:08:41 +0200 Subject: [PATCH] Fix: Narrowing cast in one storybook command CompanyID is 8 bit wide, so this incorrect cast would make it impossible to create story page elements for pages past 255. --- src/story.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/story.cpp b/src/story.cpp index 38faafd2f5d7..4c7063cf0c3d 100644 --- a/src/story.cpp +++ b/src/story.cpp @@ -154,7 +154,7 @@ CommandCost CmdCreateStoryPageElement(TileIndex tile, DoCommandFlag flags, uint3 { if (!StoryPageElement::CanAllocateItem()) return CMD_ERROR; - StoryPageID page_id = (CompanyID)GB(p1, 0, 16); + StoryPageID page_id = (StoryPageID)GB(p1, 0, 16); StoryPageElementType type = Extract(p1); /* Allow at most 128 elements per page. */