mirror of https://github.com/OpenTTD/OpenTTD
parent
2d7ad9f717
commit
25d1238907
|
@ -285,14 +285,18 @@
|
||||||
{
|
{
|
||||||
if (!_networking || _network_server) {
|
if (!_networking || _network_server) {
|
||||||
Company *c = Company::GetIfValid(company);
|
Company *c = Company::GetIfValid(company);
|
||||||
assert(c != nullptr && c->ai_instance != nullptr);
|
assert(c != nullptr);
|
||||||
|
|
||||||
Backup<CompanyID> cur_company(_current_company, company, FILE_LINE);
|
/* When doing emergency saving, an AI can be not fully initialised. */
|
||||||
c->ai_instance->Save();
|
if (c->ai_instance != nullptr) {
|
||||||
cur_company.Restore();
|
Backup<CompanyID> cur_company(_current_company, company, FILE_LINE);
|
||||||
} else {
|
c->ai_instance->Save();
|
||||||
AIInstance::SaveEmpty();
|
cur_company.Restore();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AIInstance::SaveEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void AI::GetConsoleList(std::back_insert_iterator<std::string> &output_iterator, bool newest_only)
|
/* static */ void AI::GetConsoleList(std::back_insert_iterator<std::string> &output_iterator, bool newest_only)
|
||||||
|
|
Loading…
Reference in New Issue