summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-01-15 11:43:06 +0000
committerpeter1138 <peter1138@openttd.org>2008-01-15 11:43:06 +0000
commitef704510cd5e648fc6d5b8e053e184185826e897 (patch)
tree0505b0144b9c610665622386a5515968834d6817 /src/station_cmd.cpp
parentb4d476b7d1bd43dcd0655a7121b62a571e9bba3b (diff)
downloadopenttd-ef704510cd5e648fc6d5b8e053e184185826e897.tar.xz
(svn r11860) -Fix: Test station class validity against number of classes, not abosolute limit.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
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));