forked from mirror/OpenTTD
(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)
This commit is contained in:
5
town.h
5
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)
|
||||
|
||||
|
Reference in New Issue
Block a user