summaryrefslogtreecommitdiff
path: root/town.h
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-05-09 22:33:00 +0000
committerDarkvater <darkvater@openttd.org>2005-05-09 22:33:00 +0000
commitab954a934a20e21dc9e2672c380d8a7ab8531d33 (patch)
treeadf0a3467d8519f1ef67e90a0a06731ea8c4dc1a /town.h
parent4ad80ae872fe2eea09d431a1d9849936ac37223b (diff)
downloadopenttd-ab954a934a20e21dc9e2672c380d8a7ab8531d33.tar.xz
(svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
- CodeChange: changed the airport gui airport-type checking. Added function GetValidAirports() that returns bitmasked availibility, is also used for checking. - CodeChange: to check tree-planting, 2 const arrays have been moved to table/tree_land.h (type and count) - CodeChange: added IsTownIndex() in following of IsStationIndex(), etc. - Fix (regression): road tunnels did not work anymore, forgot that their type was 0x200 (documented now)
Diffstat (limited to 'town.h')
-rw-r--r--town.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/town.h b/town.h
index b4a588de1..b3e0d4da1 100644
--- a/town.h
+++ b/town.h
@@ -157,6 +157,11 @@ static inline uint16 GetTownPoolSize(void)
return _town_pool.total_items;
}
+static inline bool IsTownIndex(uint index)
+{
+ return index < GetTownPoolSize();
+}
+
#define FOR_ALL_TOWNS_FROM(t, start) for (t = GetTown(start); t != NULL; t = (t->index + 1 < GetTownPoolSize()) ? GetTown(t->index + 1) : NULL)
#define FOR_ALL_TOWNS(t) FOR_ALL_TOWNS_FROM(t, 0)