mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-03 12:59:33 +00:00
(svn r19932) -Codechange: Preserve _current_company when starting AIs.
This commit is contained in:
parent
1d3adb2b66
commit
e852bf154f
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user