summaryrefslogtreecommitdiff
path: root/src/subsidy.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:59:36 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:59:36 +0000
commit77b7366c2947a3f2545d5542021be1cc203a74e8 (patch)
tree5fac077be3e90460822aa50987f903fb8f86a7aa /src/subsidy.cpp
parente7cd301d3c9990b4ef9f0748789bb5e0318c0d24 (diff)
downloadopenttd-77b7366c2947a3f2545d5542021be1cc203a74e8.tar.xz
(svn r23622) -Add: a set of events to trigger in a GameScript
Diffstat (limited to 'src/subsidy.cpp')
-rw-r--r--src/subsidy.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/subsidy.cpp b/src/subsidy.cpp
index 384011d40..6e4ee0694 100644
--- a/src/subsidy.cpp
+++ b/src/subsidy.cpp
@@ -23,6 +23,7 @@
#include "subsidy_func.h"
#include "core/pool_func.hpp"
#include "core/random_func.hpp"
+#include "game/game.hpp"
#include "table/strings.h"
@@ -58,6 +59,7 @@ void Subsidy::AwardTo(CompanyID company)
cn
);
AI::BroadcastNewEvent(new ScriptEventSubsidyAwarded(this->index));
+ Game::NewEvent(new ScriptEventSubsidyAwarded(this->index));
InvalidateWindowData(WC_SUBSIDIES_LIST, 0);
}
@@ -202,6 +204,7 @@ void CreateSubsidy(CargoID cid, SourceType src_type, SourceID src, SourceType ds
SetPartOfSubsidyFlag(s->src_type, s->src, POS_SRC);
SetPartOfSubsidyFlag(s->dst_type, s->dst, POS_DST);
AI::BroadcastNewEvent(new ScriptEventSubsidyOffer(s->index));
+ Game::NewEvent(new ScriptEventSubsidyOffer(s->index));
}
@@ -375,12 +378,14 @@ void SubsidyMonthlyLoop()
Pair reftype = SetupSubsidyDecodeParam(s, true);
AddNewsItem(STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED, NS_SUBSIDIES, (NewsReferenceType)reftype.a, s->src, (NewsReferenceType)reftype.b, s->dst);
AI::BroadcastNewEvent(new ScriptEventSubsidyOfferExpired(s->index));
+ Game::NewEvent(new ScriptEventSubsidyOfferExpired(s->index));
} else {
if (s->awarded == _local_company) {
Pair reftype = SetupSubsidyDecodeParam(s, true);
AddNewsItem(STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE, NS_SUBSIDIES, (NewsReferenceType)reftype.a, s->src, (NewsReferenceType)reftype.b, s->dst);
}
AI::BroadcastNewEvent(new ScriptEventSubsidyExpired(s->index));
+ Game::NewEvent(new ScriptEventSubsidyExpired(s->index));
}
delete s;
modified = true;