# HG changeset patch # User celestar # Date 2006-04-08 05:24:29 # Node ID e7fed2d1f48baff8531ea0c5fd5cc504ba545dd8 # Parent 7bb63a39c588ec0ccaaf39bf8548096357bb6b59 (svn r4319) -Codechange: Station map accessors diff --git a/station_cmd.c b/station_cmd.c --- a/station_cmd.c +++ b/station_cmd.c @@ -1926,11 +1926,11 @@ static void DrawTile_Station(TileInfo *t 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 --- a/station_map.h +++ b/station_map.h @@ -223,6 +223,12 @@ static inline uint GetCustomStationSprit 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) {