summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2019-07-17 22:08:41 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-07-18 09:36:12 +0200
commit331eba544a4d87ef269043d41951e289a8a16a32 (patch)
treeb9a26519ea1276b21bb3268c1e0815aa1c5f2b12 /src
parent88950d8f2337e680fc7622318a9f18f77e84a341 (diff)
downloadopenttd-331eba544a4d87ef269043d41951e289a8a16a32.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/story.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/story.cpp b/src/story.cpp
index 38faafd2f..4c7063cf0 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<StoryPageElementType, 16, 8>(p1);
/* Allow at most 128 elements per page. */