(svn r4757) - Newstations: add saveload support for custom station speclists

This commit is contained in:
peter1138
2006-05-06 21:46:26 +00:00
parent db77493ac0
commit 6b8b8395e4
6 changed files with 53 additions and 2 deletions

View File

@@ -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