(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:
Darkvater
2005-05-09 22:33:00 +00:00
parent 4ad80ae872
commit ab954a934a
12 changed files with 260 additions and 215 deletions

5
town.h
View File

@@ -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)