From 75fa1601f2d3ae36079ed0555c46ebe64c2bef46 Mon Sep 17 00:00:00 2001 From: celestar Date: Sat, 8 Apr 2006 05:24:29 +0000 Subject: (svn r4319) -Codechange: Station map accessors --- station_cmd.c | 4 ++-- station_map.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/station_cmd.c b/station_cmd.c index 86f47b77d..51a863c4f 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -1926,11 +1926,11 @@ static void DrawTile_Station(TileInfo *ti) relocation = GetCustomStationRelocation(statspec, st, 0); //debug("Relocation %d", relocation); - t = &statspec->renderdata[ti->map5]; + t = &statspec->renderdata[GetStationGfx(ti->tile)]; } } - if (t == NULL) t = &_station_display_datas[ti->map5]; + if (t == NULL) t = &_station_display_datas[GetStationGfx(ti->tile)]; image = t->ground_sprite; if (image & PALETTE_MODIFIER_COLOR) image |= image_or_modificator; diff --git a/station_map.h b/station_map.h index 9c608af9b..56cd8d7b0 100644 --- a/station_map.h +++ b/station_map.h @@ -223,6 +223,12 @@ static inline uint GetCustomStationSprite(TileIndex t) return _m[t].m4; } +static inline byte GetStationGfx(TileIndex t) +{ + assert(IsTileType(t, MP_STATION)); + return _m[t].m5; +} + static inline void MakeStation(TileIndex t, Owner o, StationID sid, byte m5) { -- cgit v1.2.3-70-g09d2