summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-05-26 14:16:23 +0000
committerfrosch <frosch@openttd.org>2012-05-26 14:16:23 +0000
commitec91dc5ffcf0eaac777e1f87edec61d0899193e5 (patch)
treee1d9d9183fcd7e3ed8fe0482143e69458c15fc8a /src/town_cmd.cpp
parent5187c2b721f81a16fb5526df75df79e3994a855f (diff)
downloadopenttd-ec91dc5ffcf0eaac777e1f87edec61d0899193e5.tar.xz
(svn r24287) -Feature [FS#2688]: News item for exclusive transport rights. (based on patch by Grantovich)
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 341aaeb0c..dbff6dbc5 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2824,6 +2824,15 @@ static CommandCost TownActionBuyRights(Town *t, DoCommandFlag flags)
ModifyStationRatingAround(t->xy, _current_company, 130, 17);
SetWindowClassesDirty(WC_STATION_VIEW);
+
+ /* Spawn news message */
+ CompanyNewsInformation *cni = MallocT<CompanyNewsInformation>(1);
+ cni->FillData(Company::Get(_current_company));
+ SetDParam(0, STR_NEWS_EXCLUSIVE_RIGHTS_TITLE);
+ SetDParam(1, STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION);
+ SetDParam(2, t->index);
+ SetDParamStr(3, cni->company_name);
+ AddNewsItem(STR_MESSAGE_NEWS_FORMAT, NT_GENERAL, NF_COMPANY, NR_TOWN, t->index, NR_NONE, UINT32_MAX, cni);
}
return CommandCost();
}