/* static */ void AI::Stop(CompanyID company)
{
if (_networking && !_network_server) return;
Backup<CompanyByte> cur_company(_current_company, company, FILE_LINE);
Company *c = Company::Get(company);
delete c->ai_instance;
c->ai_instance = NULL;
c->ai_info = NULL;
cur_company.Restore();
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
if (AIConfig::GetConfig(company)->IsRandom()) {
AIConfig::GetConfig(company)->Change(NULL);
}
InvalidateWindowData(WC_AI_SETTINGS, company);
}