diff options
author | zuu <zuu@openttd.org> | 2013-11-16 17:41:57 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2013-11-16 17:41:57 +0000 |
commit | 6fc653d2d729d8a5c0efeba9f588e6523c3ea13d (patch) | |
tree | 76a9ebd0678eee9121a811696a8de6e1f6cb5681 /src/goal.cpp | |
parent | f10d2417d8922f7243bcd7e4582bb1a329f6b86c (diff) | |
download | openttd-6fc653d2d729d8a5c0efeba9f588e6523c3ea13d.tar.xz |
(svn r26012) -Add: new goal type that show a story page when clicked
Diffstat (limited to 'src/goal.cpp')
-rw-r--r-- | src/goal.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/goal.cpp b/src/goal.cpp index 2bd74b9c8..1bc87ad82 100644 --- a/src/goal.cpp +++ b/src/goal.cpp @@ -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; } |