summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-03-20 10:59:06 +0000
committeralberth <alberth@openttd.org>2010-03-20 10:59:06 +0000
commit7ef97932d93050d2e0fb78e77179945d5904e392 (patch)
tree035beb125c8604cf0afe98875c78971e8b6d9570 /src/town_cmd.cpp
parente89f154c0df1d3a15237502e897eeb34f50c7293 (diff)
downloadopenttd-7ef97932d93050d2e0fb78e77179945d5904e392.tar.xz
(svn r19479) -Codechange: Test range of town size and layout instead of against the current last value.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index c3d3ceded..b7e054b71 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1525,8 +1525,8 @@ CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
bool random = HasBit(p1, 6);
uint32 townnameparts = p2;
- if (size > TSZ_RANDOM) return CMD_ERROR;
- if (layout > TL_RANDOM) return CMD_ERROR;
+ if (size >= TSZ_END) return CMD_ERROR;
+ if (layout >= NUM_TLS) return CMD_ERROR;
/* Some things are allowed only in the scenario editor */
if (_game_mode != GM_EDITOR) {