summaryrefslogtreecommitdiff
path: root/src/industry_cmd.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/industry_cmd.cpp
parente7cd301d3c9990b4ef9f0748789bb5e0318c0d24 (diff)
downloadopenttd-77b7366c2947a3f2545d5542021be1cc203a74e8.tar.xz
(svn r23622) -Add: a set of events to trigger in a GameScript
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index ca6315438..2126a6cac 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -39,6 +39,7 @@
#include "subsidy_func.h"
#include "core/backup_type.hpp"
#include "object_base.h"
+#include "game/game.hpp"
#include "table/strings.h"
#include "table/industry_land.h"
@@ -482,6 +483,7 @@ static CommandCost ClearTile_Industry(TileIndex tile, DoCommandFlag flags)
if (flags & DC_EXEC) {
AI::BroadcastNewEvent(new ScriptEventIndustryClose(i->index));
+ Game::NewEvent(new ScriptEventIndustryClose(i->index));
delete i;
}
return CommandCost(EXPENSES_CONSTRUCTION, indspec->GetRemovalCost());
@@ -1876,6 +1878,7 @@ CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
}
AddIndustryNewsItem(indspec->new_industry_text, NS_INDUSTRY_OPEN, ind->index);
AI::BroadcastNewEvent(new ScriptEventIndustryOpen(ind->index));
+ Game::NewEvent(new ScriptEventIndustryOpen(ind->index));
}
return CommandCost(EXPENSES_OTHER, indspec->GetConstructionCost());
@@ -1989,6 +1992,7 @@ static void AdvertiseIndustryOpening(const Industry *ind)
}
AddIndustryNewsItem(ind_spc->new_industry_text, NS_INDUSTRY_OPEN, ind->index);
AI::BroadcastNewEvent(new ScriptEventIndustryOpen(ind->index));
+ Game::NewEvent(new ScriptEventIndustryOpen(ind->index));
}
/**
@@ -2597,6 +2601,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
if (closeit) {
ns = NS_INDUSTRY_CLOSE;
AI::BroadcastNewEvent(new ScriptEventIndustryClose(i->index));
+ Game::NewEvent(new ScriptEventIndustryClose(i->index));
} else {
switch (WhoCanServiceIndustry(i)) {
case 0: ns = NS_INDUSTRY_NOBODY; break;