# HG changeset patch # User peter1138 # Date 1200397386 0 # Node ID 1f062b9f10f692851e787e7f73ce6539c63cebb3 # Parent da492894bd1b6dbf8c231c5b235cce429956dab6 (svn r11860) -Fix: Test station class validity against number of classes, not abosolute limit. diff -r da492894bd1b -r 1f062b9f10f6 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));