diff options
author | truebrain <truebrain@openttd.org> | 2011-12-02 23:40:24 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-02 23:40:24 +0000 |
commit | f259e6bf5d99fd43ce881cb957ad5295ee9bd548 (patch) | |
tree | 91bd9d4f58436d062bb594e1c7d94186b9b178bd /src/company_cmd.cpp | |
parent | 13c3993e861fc4eb57ac9a81d127db9e378e498e (diff) | |
download | openttd-f259e6bf5d99fd43ce881cb957ad5295ee9bd548.tar.xz |
(svn r23398) -Fix: the AIEvent.ET_COMPANY_NEW was only triggered if a company named itself, which seems like a very odd place to do so. Trigger it when the company is created instead
Diffstat (limited to 'src/company_cmd.cpp')
-rw-r--r-- | src/company_cmd.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 692431e6e..0ecd43671 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -375,7 +375,6 @@ set_name:; SetDParam(3, t->index); AddNewsItem(STR_MESSAGE_NEWS_FORMAT, NS_COMPANY_NEW, NR_TILE, c->last_build_coordinate, NR_NONE, UINT32_MAX, cni); } - AI::BroadcastNewEvent(new ScriptEventCompanyNew(c->index), c->index); return; } bad_town_name:; @@ -563,6 +562,8 @@ 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); + return c; } |