@@ -25,12 +25,17 @@ static inline Depot *GetDepot(uint index
*/
static inline uint16 GetDepotPoolSize(void)
{
return _depot_pool.total_items;
}
static inline bool IsDepotIndex(uint index)
return index < GetDepotPoolSize();
#define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1 < GetDepotPoolSize()) ? GetDepot(d->index + 1) : NULL)
#define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0)
#define MIN_SERVINT_PERCENT 5
#define MAX_SERVINT_PERCENT 90
#define MIN_SERVINT_DAYS 30
@@ -41,13 +46,13 @@ VARDEF TileIndex _last_built_road_depot_
VARDEF TileIndex _last_built_aircraft_depot_tile;
VARDEF TileIndex _last_built_ship_depot_tile;
/**
* Check if a depot really exists.
static inline bool IsValidDepot(Depot* depot)
static inline bool IsValidDepot(const Depot* depot)
return depot->xy != 0; /* XXX: Replace by INVALID_TILE someday */
* Check if a tile is a depot of the given type.