summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/newgrf_airporttiles.cpp10
-rw-r--r--src/newgrf_airporttiles.h1
-rw-r--r--src/station_cmd.cpp2
3 files changed, 12 insertions, 1 deletions
diff --git a/src/newgrf_airporttiles.cpp b/src/newgrf_airporttiles.cpp
index 9de3f38fd..22e739eed 100644
--- a/src/newgrf_airporttiles.cpp
+++ b/src/newgrf_airporttiles.cpp
@@ -48,6 +48,16 @@ AirportTileOverrideManager _airporttile_mngr(NEW_AIRPORTTILE_OFFSET, NUM_AIRPORT
}
/**
+ * Retrieve airport tile spec for the given airport tile.
+ * @param tile The airport tile.
+ * @return A pointer to the corresponding AirportTileSpec.
+ */
+/* static */ const AirportTileSpec *AirportTileSpec::GetByTile(TileIndex tile)
+{
+ return AirportTileSpec::Get(GetAirportGfx(tile));
+}
+
+/**
* This function initializes the tile array of AirportTileSpec
*/
void AirportTileSpec::ResetAirportTiles()
diff --git a/src/newgrf_airporttiles.h b/src/newgrf_airporttiles.h
index 83c594024..61b0a2b1c 100644
--- a/src/newgrf_airporttiles.h
+++ b/src/newgrf_airporttiles.h
@@ -29,6 +29,7 @@ struct AirportTileSpec {
GRFFileProps grf_prop; ///< properties related the the grf file
static const AirportTileSpec *Get(StationGfx gfx);
+ static const AirportTileSpec *GetByTile(TileIndex tile);
static void ResetAirportTiles();
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 8d53487b7..a1b971527 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2807,7 +2807,7 @@ static void GetTileDesc_Station(TileIndex tile, TileDesc *td)
}
if (IsAirport(tile)) {
- const AirportTileSpec *ats = AirportTileSpec::Get(GetAirportGfx(tile));
+ const AirportTileSpec *ats = AirportTileSpec::GetByTile(tile);
td->airport_tile_name = ats->name;
if (ats->grf_prop.grffile != NULL) {