Changeset - r23783:906f2fc799bf
[Not reviewed]
master
0 1 0
Niels Martin Hansen - 5 years ago 2019-07-17 20:08:41
nielsm@indvikleren.dk
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.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/story.cpp
Show inline comments
 
@@ -154,7 +154,7 @@ CommandCost CmdCreateStoryPageElement(Ti
 
{
 
	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. */
0 comments (0 inline, 0 general)