diff options
author | Darkvater <Darkvater@openttd.org> | 2006-03-26 22:55:27 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2006-03-26 22:55:27 +0000 |
commit | d155f182acc63d3eaea1f31ec13faae6955bfc47 (patch) | |
tree | 5375ce61c67417cfbafdc80258742b527d4675c3 /station.h | |
parent | 0df43399414ee0fd33f314116d75fb754837d3e3 (diff) | |
download | openttd-d155f182acc63d3eaea1f31ec13faae6955bfc47.tar.xz |
(svn r4131) - CodeChange: Add proper semantics for StationID for such variables instead of using the general uint16-type. StationID was added for depots, waypoints and stations where necessary. We probably need to change GetDepot(), IsDepotIndex(), IsStationIndex(), GetWaypoint() and IsWaypointIndex() as well to use StationID.
Diffstat (limited to 'station.h')
-rw-r--r-- | station.h | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -14,7 +14,7 @@ typedef struct GoodsEntry { uint16 waiting_acceptance; byte days_since_pickup; byte rating; - uint16 enroute_from; + StationID enroute_from; byte enroute_time; byte last_speed; byte last_age; @@ -32,8 +32,6 @@ enum { ROAD_STOP_LIMIT = 16, }; -typedef uint16 StationID; - typedef struct RoadStop { TileIndex xy; bool used; @@ -150,7 +148,7 @@ static inline uint16 GetStationPoolSize(void) return _station_pool.total_items; } -static inline bool IsStationIndex(uint index) +static inline bool IsStationIndex(StationID index) { return index < GetStationPoolSize(); } |