diff options
author | rubidium <rubidium@openttd.org> | 2009-07-17 20:51:24 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-07-17 20:51:24 +0000 |
commit | d8f16ea1994ecebdb153c58350b3a044a6d43e57 (patch) | |
tree | 1af8506b6b3e5656b1ccbd30d75f04571c191306 /src/waypoint.h | |
parent | c9cab7ba1967a42b90b44bca865db33c66a20c72 (diff) | |
download | openttd-d8f16ea1994ecebdb153c58350b3a044a6d43e57.tar.xz |
(svn r16863) -Codechange: GetWaypointByTile -> Waypoint::GetByTile, like used for e.g. stations
Diffstat (limited to 'src/waypoint.h')
-rw-r--r-- | src/waypoint.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/waypoint.h b/src/waypoint.h index 7e540ecc2..f8f733ad8 100644 --- a/src/waypoint.h +++ b/src/waypoint.h @@ -39,23 +39,21 @@ struct Waypoint : WaypointPool::PoolItem<&_waypoint_pool> { void UpdateVirtCoord(); void AssignStationSpec(uint index); + + /** + * Fetch a waypoint by tile + * @param tile Tile of waypoint + * @return Waypoint + */ + static FORCEINLINE Waypoint *GetByTile(TileIndex tile) + { + return Waypoint::Get(GetWaypointIndex(tile)); + } }; #define FOR_ALL_WAYPOINTS_FROM(var, start) FOR_ALL_ITEMS_FROM(Waypoint, waypoint_index, var, start) #define FOR_ALL_WAYPOINTS(var) FOR_ALL_WAYPOINTS_FROM(var, 0) - -/** - * Fetch a waypoint by tile - * @param tile Tile of waypoint - * @return Waypoint - */ -static inline Waypoint *GetWaypointByTile(TileIndex tile) -{ - assert(IsRailWaypointTile(tile)); - return Waypoint::Get(GetWaypointIndex(tile)); -} - CommandCost RemoveTrainWaypoint(TileIndex tile, DoCommandFlag flags, bool justremove); Station *ComposeWaypointStation(TileIndex tile); void ShowWaypointWindow(const Waypoint *wp); |