(svn r16559) -Codechange: introduce Company::IsValidAiID() and Company::IsValidHumanID(), don't use IsHumanCompany() where possible
This commit is contained in:
@@ -43,7 +43,7 @@ static void SaveReal_AIPL(int *index_ptr)
|
||||
|
||||
SlObject(NULL, _ai_company);
|
||||
/* If the AI was active, store his data too */
|
||||
if (Company::IsValidID(index) && !IsHumanCompany(index)) AI::Save(index);
|
||||
if (Company::IsValidAiID(index)) AI::Save(index);
|
||||
}
|
||||
|
||||
static void Load_AIPL()
|
||||
@@ -59,7 +59,7 @@ static void Load_AIPL()
|
||||
SlObject(NULL, _ai_company);
|
||||
|
||||
if (_networking && !_network_server) {
|
||||
if (Company::IsValidID(index) && !IsHumanCompany(index)) AIInstance::LoadEmpty();
|
||||
if (Company::IsValidAiID(index)) AIInstance::LoadEmpty();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ static void Load_AIPL()
|
||||
config->StringToSettings(_ai_saveload_settings);
|
||||
|
||||
/* Start the AI directly if it was active in the savegame */
|
||||
if (Company::IsValidID(index) && !IsHumanCompany(index)) {
|
||||
if (Company::IsValidAiID(index)) {
|
||||
AI::StartNew(index);
|
||||
AI::Load(index, _ai_saveload_version);
|
||||
}
|
||||
|
Reference in New Issue
Block a user