diff options
author | smatz <smatz@openttd.org> | 2009-05-17 01:00:56 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-17 01:00:56 +0000 |
commit | 871107f52952ee59c353feab933126ed206e60bf (patch) | |
tree | 482884dfedc1700bddb8812f1de755212ed8bb22 /src/ai/ai_core.cpp | |
parent | ed1e54bd84074412ea9f273b7cd86aed42d844ce (diff) | |
download | openttd-871107f52952ee59c353feab933126ed206e60bf.tar.xz |
(svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index)
Diffstat (limited to 'src/ai/ai_core.cpp')
-rw-r--r-- | src/ai/ai_core.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ai/ai_core.cpp b/src/ai/ai_core.cpp index 16ad01452..df470d035 100644 --- a/src/ai/ai_core.cpp +++ b/src/ai/ai_core.cpp @@ -28,7 +28,7 @@ /* static */ void AI::StartNew(CompanyID company) { - assert(IsValidCompanyID(company)); + assert(Company::IsValidID(company)); /* Clients shouldn't start AIs */ if (_networking && !_network_server) return; @@ -74,7 +74,7 @@ * Effectively collecting garbage once every two months per AI. */ if ((AI::frame_counter & 255) == 0) { CompanyID cid = (CompanyID)GB(AI::frame_counter, 8, 4); - if (IsValidCompanyID(cid) && !IsHumanCompany(cid)) Company::Get(cid)->ai_instance->CollectGarbage(); + if (Company::IsValidID(cid) && !IsHumanCompany(cid)) Company::Get(cid)->ai_instance->CollectGarbage(); } _current_company = OWNER_NONE; @@ -178,7 +178,7 @@ } /* Only AIs can have an event-queue */ - if (!IsValidCompanyID(company) || IsHumanCompany(company)) { + if (!Company::IsValidID(company) || IsHumanCompany(company)) { event->Release(); return; } @@ -227,7 +227,7 @@ void CcAI(bool success, TileIndex tile, uint32 p1, uint32 p2) /* static */ void AI::Save(CompanyID company) { if (!_networking || _network_server) { - assert(IsValidCompanyID(company)); + assert(Company::IsValidID(company)); assert(Company::Get(company)->ai_instance != NULL); CompanyID old_company = _current_company; @@ -242,7 +242,7 @@ void CcAI(bool success, TileIndex tile, uint32 p1, uint32 p2) /* static */ void AI::Load(CompanyID company, int version) { if (!_networking || _network_server) { - assert(IsValidCompanyID(company)); + assert(Company::IsValidID(company)); assert(Company::Get(company)->ai_instance != NULL); CompanyID old_company = _current_company; @@ -259,7 +259,7 @@ void CcAI(bool success, TileIndex tile, uint32 p1, uint32 p2) { /* Find the first company which doesn't exist yet */ for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { - if (!IsValidCompanyID(c)) return AIConfig::GetConfig(c)->GetSetting("start_date"); + if (!Company::IsValidID(c)) return AIConfig::GetConfig(c)->GetSetting("start_date"); } /* Currently no AI can be started, check again in a year. */ |