mirror of https://github.com/OpenTTD/OpenTTD.git
(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);
|
config->ChangeAI(info->GetName(), -1, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
_current_company = company;
|
Backup<CompanyByte> cur_company(_current_company, company, FILE_LINE);
|
||||||
Company *c = Company::Get(company);
|
Company *c = Company::Get(company);
|
||||||
|
|
||||||
c->ai_info = info;
|
c->ai_info = info;
|
||||||
assert(c->ai_instance == NULL);
|
assert(c->ai_instance == NULL);
|
||||||
c->ai_instance = new AIInstance(info);
|
c->ai_instance = new AIInstance(info);
|
||||||
|
|
||||||
|
cur_company.Restore();
|
||||||
|
|
||||||
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
|
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue