(svn r20406) -Codechange: make StationClass use the new generic class

This commit is contained in:
rubidium
2010-08-07 22:07:07 +00:00
parent abcd7ffa5f
commit 40ab6a3298
9 changed files with 60 additions and 208 deletions

View File

@@ -169,7 +169,7 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
/* Check if the given station class is valid */
if (spec_class != STAT_CLASS_WAYP) return CMD_ERROR;
if (spec_index >= GetNumCustomStations(spec_class)) return CMD_ERROR;
if (spec_index >= StationClass::GetCount(spec_class)) return CMD_ERROR;
/* The number of parts to build */
byte count = axis == AXIS_X ? height : width;
@@ -241,7 +241,7 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
wp->UpdateVirtCoord();
const StationSpec *spec = GetCustomStationSpec(spec_class, spec_index);
const StationSpec *spec = StationClass::Get(spec_class, spec_index);
byte *layout_ptr = AllocaM(byte, count);
if (spec == NULL) {
/* The layout must be 0 for the 'normal' waypoints by design. */