diff options
author | frosch <frosch@openttd.org> | 2012-04-22 16:28:14 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-04-22 16:28:14 +0000 |
commit | 0f0e7e43cf09c0ff82e4119b08956670160aaa58 (patch) | |
tree | 73eac59bde99d2517e2766ada36995fe7952d2d3 /src/station_cmd.cpp | |
parent | cb434944885d5e5caa857deb3273712c4c223031 (diff) | |
download | openttd-0f0e7e43cf09c0ff82e4119b08956670160aaa58.tar.xz |
(svn r24166) -Codechange: Turn NewGRFClass::Get(Tid, uint) and GetCount(Tid) into non-static members GetSpec(uint) and GetSpecCount().
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 08b1cad1d..254f0d346 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -744,7 +744,7 @@ static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag fl int allowed_z = -1; uint invalid_dirs = 5 << axis; - const StationSpec *statspec = StationClass::Get(spec_class, spec_index); + const StationSpec *statspec = StationClass::Get(spec_class)->GetSpec(spec_index); bool slope_cb = statspec != NULL && HasBit(statspec->callback_mask, CBM_STATION_SLOPE_CHECK); TILE_AREA_LOOP(tile_cur, tile_area) { @@ -1106,7 +1106,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 /* Check if the given station class is valid */ 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 (spec_index >= StationClass::Get(spec_class)->GetSpecCount()) return CMD_ERROR; if (plat_len == 0 || numtracks == 0) return CMD_ERROR; int w_org, h_org; @@ -1175,7 +1175,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 } /* Check if we can allocate a custom stationspec to this station */ - const StationSpec *statspec = StationClass::Get(spec_class, spec_index); + const StationSpec *statspec = StationClass::Get(spec_class)->GetSpec(spec_index); int specindex = AllocateSpecToStation(statspec, st, (flags & DC_EXEC) != 0); if (specindex == -1) return_cmd_error(STR_ERROR_TOO_MANY_STATION_SPECS); |