(svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index)
This commit is contained in:
@@ -83,12 +83,12 @@ struct Company : PoolItem<Company, CompanyByte, &_Company_pool> {
|
||||
uint16 *num_engines; ///< caches the number of engines of each type the company owns (no need to save this)
|
||||
|
||||
inline bool IsValid() const { return this->name_1 != 0; }
|
||||
};
|
||||
|
||||
static inline bool IsValidCompanyID(CompanyID company)
|
||||
{
|
||||
return company < MAX_COMPANIES && (uint)company < Company::GetPoolSize() && Company::Get(company)->IsValid();
|
||||
}
|
||||
static inline bool IsValidID(CompanyID company)
|
||||
{
|
||||
return company < MAX_COMPANIES && (uint)company < Company::GetPoolSize() && Company::Get(company)->IsValid();
|
||||
}
|
||||
};
|
||||
|
||||
#define FOR_ALL_COMPANIES_FROM(d, start) for (d = Company::Get(start); d != NULL; d = (d->index + 1U < Company::GetPoolSize()) ? Company::Get(d->index + 1U) : NULL) if (d->IsValid())
|
||||
#define FOR_ALL_COMPANIES(d) FOR_ALL_COMPANIES_FROM(d, 0)
|
||||
|
||||
Reference in New Issue
Block a user