newgrf_station.c
changeset 3765 a4ddbff73f9f
parent 3764 f017ce73e96b
child 3766 fc2dea6ef369
--- a/newgrf_station.c	Sat May 06 20:48:40 2006 +0000
+++ b/newgrf_station.c	Sat May 06 21:46:26 2006 +0000
@@ -164,6 +164,23 @@
 }
 
 
+const StationSpec *GetCustomStationSpecByGrf(uint32 grfid, byte localidx)
+{
+	StationClassID i;
+	uint j;
+
+	for (i = STAT_CLASS_DFLT; i < STAT_CLASS_MAX; i++) {
+		for (j = 0; j < station_classes[i].stations; j++) {
+			const StationSpec *statspec = station_classes[i].spec[j];
+			if (statspec == NULL) continue;
+			if (statspec->grfid == grfid && statspec->localidx == localidx) return statspec;
+		}
+	}
+
+	return NULL;
+}
+
+
 /* Evaluate a tile's position within a station, and return the result a bitstuffed format.
  * if not centred: .TNLcCpP, if centred: .TNL..CP
  * T = Tile layout number (GetStationGfx), N = Number of platforms, L = Length of platforms