mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-03 09:48:05 +01:00
(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
This commit is contained in:
parent
13c3993e86
commit
f259e6bf5d
@ -375,7 +375,6 @@ set_name:;
|
|||||||
SetDParam(3, t->index);
|
SetDParam(3, t->index);
|
||||||
AddNewsItem(STR_MESSAGE_NEWS_FORMAT, NS_COMPANY_NEW, NR_TILE, c->last_build_coordinate, NR_NONE, UINT32_MAX, cni);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
bad_town_name:;
|
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);
|
if (is_ai && (!_networking || _network_server)) AI::StartNew(c->index);
|
||||||
|
|
||||||
|
AI::BroadcastNewEvent(new ScriptEventCompanyNew(c->index), c->index);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user