mirror of https://github.com/OpenTTD/OpenTTD
(svn r15401) -Fix [FS#2619](r15027): AI::Stop changed _current_company, but didn't restore its original value
parent
4e8707b93f
commit
9c59b711b7
|
@ -88,12 +88,15 @@
|
||||||
{
|
{
|
||||||
if (_networking && !_network_server) return;
|
if (_networking && !_network_server) return;
|
||||||
|
|
||||||
|
CompanyID old_company = _current_company;
|
||||||
_current_company = company;
|
_current_company = company;
|
||||||
Company *c = GetCompany(company);
|
Company *c = GetCompany(company);
|
||||||
|
|
||||||
delete c->ai_instance;
|
delete c->ai_instance;
|
||||||
c->ai_instance = NULL;
|
c->ai_instance = NULL;
|
||||||
|
|
||||||
|
_current_company = old_company;
|
||||||
|
|
||||||
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
|
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue