(svn r23622) -Add: a set of events to trigger in a GameScript

This commit is contained in:
truebrain
2011-12-19 20:59:36 +00:00
parent e7cd301d3c
commit 77b7366c29
15 changed files with 310 additions and 13 deletions

View File

@@ -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;
}