(svn r11860) -Fix: Test station class validity against number of classes, not abosolute limit.
authorpeter1138
Tue, 15 Jan 2008 11:43:06 +0000
changeset 8296 59fa0940aefe
parent 8295 70fa977c9c65
child 8297 74bb009bff83
(svn r11860) -Fix: Test station class validity against number of classes, not abosolute limit.
src/station_cmd.cpp
--- a/src/station_cmd.cpp	Tue Jan 15 10:36:51 2008 +0000
+++ b/src/station_cmd.cpp	Tue Jan 15 11:43:06 2008 +0000
@@ -1004,7 +1004,7 @@
 	}
 
 	/* 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));