Mercurial > hg > openttd
changeset 8296:f3452c2b7b01 draft
(svn r11860) -Fix: Test station class validity against number of classes, not abosolute limit.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Tue, 15 Jan 2008 11:43:06 +0000 |
parents | 9b35e1d5ebed |
children | 6556baf1d76d |
files | src/station_cmd.cpp |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -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));