summaryrefslogtreecommitdiff
path: root/src/station_base.h
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-01-18 14:32:47 +0000
committeryexo <yexo@openttd.org>2010-01-18 14:32:47 +0000
commita1f28ec88bf3987236fb1b9df9c9dbe8c68419b7 (patch)
tree1fe3a4233e91327653fa7aab2bb766aa187d0909 /src/station_base.h
parent565ad802b11f5ceab8e354a3c6aaf530998529d1 (diff)
downloadopenttd-a1f28ec88bf3987236fb1b9df9c9dbe8c68419b7.tar.xz
(svn r18860) -Codechange: introduce a wrapper to get an hangar tile from a station
Diffstat (limited to 'src/station_base.h')
-rw-r--r--src/station_base.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/station_base.h b/src/station_base.h
index def8c595d..251902493 100644
--- a/src/station_base.h
+++ b/src/station_base.h
@@ -121,11 +121,18 @@ public:
return IsRailStationTile(tile) && GetStationIndex(tile) == this->index;
}
- /* virtual */ FORCEINLINE bool TileBelongsToAirport(TileIndex tile) const
+ FORCEINLINE bool TileBelongsToAirport(TileIndex tile) const
{
return IsAirportTile(tile) && GetStationIndex(tile) == this->index;
}
+ FORCEINLINE TileIndex GetHangarTile(uint hangar_num) const
+ {
+ assert(this->airport_tile != INVALID_TILE);
+ assert(hangar_num < this->GetAirportSpec()->nof_depots);
+ return this->airport_tile + ToTileIndexDiff(this->GetAirportSpec()->depot_table[hangar_num]);
+ }
+
/* virtual */ uint32 GetNewGRFVariable(const ResolverObject *object, byte variable, byte parameter, bool *available) const;
/* virtual */ void GetTileArea(TileArea *ta, StationType type) const;