From ab954a934a20e21dc9e2672c380d8a7ab8531d33 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Mon, 9 May 2005 22:33:00 +0000 Subject: (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) --- town.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'town.h') 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) -- cgit v1.2.3-54-g00ecf