diff options
author | smatz <smatz@openttd.org> | 2009-05-14 23:40:03 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-14 23:40:03 +0000 |
commit | 683a6ca039fb0c52093dd93261b6233dd6f482f3 (patch) | |
tree | 49f53b374298cdddebdeed4757dbb06b14f8ccee /src/town_cmd.cpp | |
parent | b3a539b0168c4058ffe19930a455f987778a5fbf (diff) | |
download | openttd-683a6ca039fb0c52093dd93261b6233dd6f482f3.tar.xz |
(svn r16308) -Fix: parameter is invalid when it's equal to length of an array (Yexo)
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index dc53528c8..3e8d1bdfa 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2553,7 +2553,7 @@ uint GetMaskOfTownActions(int *nump, CompanyID cid, const Town *t) */ CommandCost CmdDoTownAction(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { - if (!IsValidTownID(p1) || p2 > lengthof(_town_action_proc)) return CMD_ERROR; + if (!IsValidTownID(p1) || p2 >= lengthof(_town_action_proc)) return CMD_ERROR; Town *t = GetTown(p1); |