(svn r4319) -Codechange: Station map accessors
authorcelestar
Sat, 08 Apr 2006 05:24:29 +0000
changeset 3474 45ef140f0f34
parent 3473 c497abbf5131
child 3475 1b68d263ae0e
(svn r4319) -Codechange: Station map accessors
station_cmd.c
station_map.h
--- a/station_cmd.c	Sat Apr 08 01:07:32 2006 +0000
+++ b/station_cmd.c	Sat Apr 08 05:24:29 2006 +0000
@@ -1926,11 +1926,11 @@
 
 			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;
--- a/station_map.h	Sat Apr 08 01:07:32 2006 +0000
+++ b/station_map.h	Sat Apr 08 05:24:29 2006 +0000
@@ -223,6 +223,12 @@
 	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)
 {