summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
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 254f0d346..5a56d7a45 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1105,7 +1105,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
if (!ValParamRailtype(rt)) return CMD_ERROR;
/* Check if the given station class is valid */
- if ((uint)spec_class >= StationClass::GetCount() || spec_class == STAT_CLASS_WAYP) return CMD_ERROR;
+ if ((uint)spec_class >= StationClass::GetClassCount() || spec_class == STAT_CLASS_WAYP) return CMD_ERROR;
if (spec_index >= StationClass::Get(spec_class)->GetSpecCount()) return CMD_ERROR;
if (plat_len == 0 || numtracks == 0) return CMD_ERROR;