summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-07 22:07:07 +0000
committerrubidium <rubidium@openttd.org>2010-08-07 22:07:07 +0000
commitedbadde301d04264110b1b923ba80af367f6651c (patch)
treee9f8998e89b9811d9bc0febd58272339a63951c9 /src/station_cmd.cpp
parentcb4ab6a23158163e848ab2b5887d1eb449b86a4c (diff)
downloadopenttd-edbadde301d04264110b1b923ba80af367f6651c.tar.xz
(svn r20406) -Codechange: make StationClass use the new generic class
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 25e456062..67db95643 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1134,8 +1134,8 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
if (!ValParamRailtype(rt)) return CMD_ERROR;
/* Check if the given station class is valid */
- if ((uint)spec_class >= GetNumStationClasses() || spec_class == STAT_CLASS_WAYP) return CMD_ERROR;
- if (spec_index >= GetNumCustomStations(spec_class)) return CMD_ERROR;
+ if ((uint)spec_class >= StationClass::GetCount() || spec_class == STAT_CLASS_WAYP) return CMD_ERROR;
+ if (spec_index >= StationClass::GetCount(spec_class)) return CMD_ERROR;
if (plat_len == 0 || numtracks == 0) return CMD_ERROR;
int w_org, h_org;
@@ -1207,7 +1207,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
}
/* Check if we can allocate a custom stationspec to this station */
- const StationSpec *statspec = GetCustomStationSpec(spec_class, spec_index);
+ const StationSpec *statspec = StationClass::Get(spec_class, spec_index);
int specindex = AllocateSpecToStation(statspec, st, (flags & DC_EXEC) != 0);
if (specindex == -1) return_cmd_error(STR_ERROR_TOO_MANY_STATION_SPECS);
@@ -2801,7 +2801,7 @@ static void GetTileDesc_Station(TileIndex tile, TileDesc *td)
const StationSpec *spec = GetStationSpec(tile);
if (spec != NULL) {
- td->station_class = GetStationClassName(spec->cls_id);
+ td->station_class = StationClass::GetName(spec->cls_id);
td->station_name = spec->name;
if (spec->grf_prop.grffile != NULL) {