From ea6535c8644264d722d49d42c83f452728140599 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Tue, 15 Jan 2008 11:43:06 +0000 Subject: (svn r11860) -Fix: Test station class validity against number of classes, not abosolute limit. --- src/station_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index da9018f87..80add35b0 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -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)); -- cgit v1.2.3-70-g09d2