summaryrefslogtreecommitdiff
path: root/newgrf_station.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-05-06 21:46:26 +0000
committerpeter1138 <peter1138@openttd.org>2006-05-06 21:46:26 +0000
commit10992deeb3be7b555246222d0f9242145c5ea3b2 (patch)
treee5cbe9866001cd8c1d607bbd74d53aa35c863841 /newgrf_station.c
parenta7a194c4df25659ef71a2fd4c257a73428b4f837 (diff)
downloadopenttd-10992deeb3be7b555246222d0f9242145c5ea3b2.tar.xz
(svn r4757) - Newstations: add saveload support for custom station speclists
Diffstat (limited to 'newgrf_station.c')
-rw-r--r--newgrf_station.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/newgrf_station.c b/newgrf_station.c
index 6a930ba61..18a138602 100644
--- a/newgrf_station.c
+++ b/newgrf_station.c
@@ -164,6 +164,23 @@ const StationSpec *GetCustomStationSpec(StationClassID sclass, uint station)
}
+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