(svn r16559) -Codechange: introduce Company::IsValidAiID() and Company::IsValidHumanID(), don't use IsHumanCompany() where possible

This commit is contained in:
smatz
2009-06-10 22:05:01 +00:00
parent bc7e9514d2
commit bea3fe2b8b
14 changed files with 47 additions and 38 deletions

View File

@@ -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);
}