(svn r11860) -Fix: Test station class validity against number of classes, not abosolute limit.

This commit is contained in:
peter1138 2008-01-15 11:43:06 +00:00
parent 68a3df82b9
commit ea6535c864
1 changed files with 1 additions and 1 deletions

View File

@ -1004,7 +1004,7 @@ CommandCost CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1,
}
/* Check if the given station class is valid */
if (GB(p2, 8, 8) >= STAT_CLASS_MAX) return CMD_ERROR;
if (GB(p2, 8, 8) >= GetNumStationClasses()) return CMD_ERROR;
/* Check if we can allocate a custom stationspec to this station */
const StationSpec *statspec = GetCustomStationSpec((StationClassID)GB(p2, 8, 8), GB(p2, 16, 8));