summaryrefslogtreecommitdiff
path: root/src/town.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-17 01:00:56 +0000
committersmatz <smatz@openttd.org>2009-05-17 01:00:56 +0000
commit871107f52952ee59c353feab933126ed206e60bf (patch)
tree482884dfedc1700bddb8812f1de755212ed8bb22 /src/town.h
parented1e54bd84074412ea9f273b7cd86aed42d844ce (diff)
downloadopenttd-871107f52952ee59c353feab933126ed206e60bf.tar.xz
(svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index)
Diffstat (limited to 'src/town.h')
-rw-r--r--src/town.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/town.h b/src/town.h
index bc746fb83..db7bf04f5 100644
--- a/src/town.h
+++ b/src/town.h
@@ -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());
}