(svn r19932) -Codechange: Preserve _current_company when starting AIs.

This commit is contained in:
frosch 2010-06-05 13:29:48 +00:00
parent 1d3adb2b66
commit e852bf154f
1 changed files with 3 additions and 1 deletions

View File

@ -48,13 +48,15 @@
config->ChangeAI(info->GetName(), -1, false, true);
}
_current_company = company;
Backup<CompanyByte> cur_company(_current_company, company, FILE_LINE);
Company *c = Company::Get(company);
c->ai_info = info;
assert(c->ai_instance == NULL);
c->ai_instance = new AIInstance(info);
cur_company.Restore();
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
return;
}