(svn r26012) -Add: new goal type that show a story page when clicked

This commit is contained in:
zuu
2013-11-16 17:41:57 +00:00
parent f10d2417d8
commit 6fc653d2d7
7 changed files with 41 additions and 1 deletions

View File

@@ -19,6 +19,7 @@
#include "game/game.hpp"
#include "command_func.h"
#include "company_base.h"
#include "story_base.h"
#include "string_func.h"
#include "gui.h"
#include "network/network.h"
@@ -72,6 +73,13 @@ CommandCost CmdCreateGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
if (!Company::IsValidID(p2)) return CMD_ERROR;
break;
case GT_STORY_PAGE: {
if (!StoryPage::IsValidID(p2)) return CMD_ERROR;
CompanyByte story_company = StoryPage::Get(p2)->company;
if (company == INVALID_COMPANY ? story_company != INVALID_COMPANY : story_company != INVALID_COMPANY && story_company != company) return CMD_ERROR;
break;
}
default: return CMD_ERROR;
}