(svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index)

This commit is contained in:
smatz
2009-05-17 01:00:56 +00:00
parent cf986c3099
commit 0c10daa243
78 changed files with 242 additions and 303 deletions

View File

@@ -295,16 +295,6 @@ static inline HouseSpec *GetHouseSpecs(HouseID house_id)
TileIndexDiff GetHouseNorthPart(HouseID &house);
/**
* Check if a TownID is valid.
* @param index to inquiry in the pool of town
* @return true if it exists
*/
static inline bool IsValidTownID(TownID index)
{
return index < Town::GetPoolSize() && Town::Get(index)->IsValid();
}
static inline TownID GetMaxTownIndex()
{
/* TODO - This isn't the real content of the function, but
@@ -335,7 +325,7 @@ static inline Town *GetRandomTown()
index++;
/* Make sure we have a valid town */
while (!IsValidTownID(index)) {
while (!Town::IsValidID(index)) {
index++;
assert(index <= GetMaxTownIndex());
}