summaryrefslogtreecommitdiff
path: root/src/company_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/company_cmd.cpp
parente7cd301d3c9990b4ef9f0748789bb5e0318c0d24 (diff)
downloadopenttd-77b7366c2947a3f2545d5542021be1cc203a74e8.tar.xz
(svn r23622) -Add: a set of events to trigger in a GameScript
Diffstat (limited to 'src/company_cmd.cpp')
-rw-r--r--src/company_cmd.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 5cd965038..d4627078f 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -35,6 +35,7 @@
#include "vehicle_func.h"
#include "sprite.h"
#include "smallmap_gui.h"
+#include "game/game.hpp"
#include "table/strings.h"
@@ -563,6 +564,7 @@ Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY)
if (is_ai && (!_networking || _network_server)) AI::StartNew(c->index);
AI::BroadcastNewEvent(new ScriptEventCompanyNew(c->index), c->index);
+ Game::NewEvent(new ScriptEventCompanyNew(c->index));
return c;
}
@@ -905,6 +907,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
CompanyID c_index = c->index;
delete c;
AI::BroadcastNewEvent(new ScriptEventCompanyBankrupt(c_index));
+ Game::NewEvent(new ScriptEventCompanyBankrupt(c_index));
CompanyAdminRemove(c_index, (CompanyRemoveReason)reason);
break;
}