summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-14 23:40:03 +0000
committersmatz <smatz@openttd.org>2009-05-14 23:40:03 +0000
commit683a6ca039fb0c52093dd93261b6233dd6f482f3 (patch)
tree49f53b374298cdddebdeed4757dbb06b14f8ccee /src/station_cmd.cpp
parentb3a539b0168c4058ffe19930a455f987778a5fbf (diff)
downloadopenttd-683a6ca039fb0c52093dd93261b6233dd6f482f3.tar.xz
(svn r16308) -Fix: parameter is invalid when it's equal to length of an array (Yexo)
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 85e12fa25..1d4d2948f 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1820,7 +1820,7 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
if (distant_join && (!_settings_game.station.distant_join_stations || !IsValidStationID(station_to_join))) return CMD_ERROR;
/* Check if a valid, buildable airport was chosen for construction */
- if (p1 > lengthof(_airport_sections) || !HasBit(GetValidAirports(), p1)) return CMD_ERROR;
+ if (p1 >= lengthof(_airport_sections) || !HasBit(GetValidAirports(), p1)) return CMD_ERROR;
if (!CheckIfAuthorityAllowsNewStation(tile, flags)) {
return CMD_ERROR;