summaryrefslogtreecommitdiff
path: root/src/subsidy.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-05-24 17:23:24 +0000
committerfrosch <frosch@openttd.org>2009-05-24 17:23:24 +0000
commitad64d5eedb2f7282b72d06a9bb14e40c88914f0f (patch)
treece21eeacf61790b82e1a47e94a806aafc27a8496 /src/subsidy.cpp
parent7f9c192a9568e268d70a0b7bfdd381556ae74842 (diff)
downloadopenttd-ad64d5eedb2f7282b72d06a9bb14e40c88914f0f.tar.xz
(svn r16418) -Fix: Resolve the company name for 'subsidy awarded'-news when the news are triggered, so it stays valid when the company bankrupts or is taken over.
Diffstat (limited to 'src/subsidy.cpp')
-rw-r--r--src/subsidy.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/subsidy.cpp b/src/subsidy.cpp
index 4b6fc22dd..c61129099 100644
--- a/src/subsidy.cpp
+++ b/src/subsidy.cpp
@@ -335,11 +335,16 @@ bool CheckSubsidised(const Station *from, const Station *to, CargoID cargo_type)
Pair reftype = SetupSubsidyDecodeParam(s, 0);
InjectDParam(1);
+ char *company_name = MallocT<char>(MAX_LENGTH_COMPANY_NAME_BYTES);
SetDParam(0, _current_company);
+ GetString(company_name, STR_COMPANY_NAME, company_name + MAX_LENGTH_COMPANY_NAME_BYTES - 1);
+
+ SetDParamStr(0, company_name);
AddNewsItem(
STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF + _settings_game.difficulty.subsidy_multiplier,
NS_SUBSIDIES,
- (NewsReferenceType)reftype.a, s->from, (NewsReferenceType)reftype.b, s->to
+ (NewsReferenceType)reftype.a, s->from, (NewsReferenceType)reftype.b, s->to,
+ company_name
);
AI::BroadcastNewEvent(new AIEventSubsidyAwarded(s - _subsidies));