diff options
author | smatz <smatz@openttd.org> | 2009-06-20 11:25:39 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-06-20 11:25:39 +0000 |
commit | 4419366f94f75032b53362e2722b6476beb02866 (patch) | |
tree | 2d092dc3dc2fea7055ac87bc739b223a83efbeb5 /src/map.cpp | |
parent | 88ec646c1f843b95635510988c793e4e83cbc8cc (diff) | |
download | openttd-4419366f94f75032b53362e2722b6476beb02866.tar.xz |
(svn r16603) -Codechange: enumify map size limits (based on a patch by Bilbo)
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map.cpp b/src/map.cpp index 3dfe47890..836a0a8fd 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -34,9 +34,9 @@ TileExtended *_me = NULL; ///< Extended Tiles of the map void AllocateMap(uint size_x, uint size_y) { /* Make sure that the map size is within the limits and that - * the x axis size is a power of 2. */ - if (size_x < 64 || size_x > 2048 || - size_y < 64 || size_y > 2048 || + * size of both axes is a power of 2. */ + if (!IsInsideMM(size_x, MIN_MAP_SIZE, MAX_MAP_SIZE + 1) || + !IsInsideMM(size_y, MIN_MAP_SIZE, MAX_MAP_SIZE + 1) || (size_x & (size_x - 1)) != 0 || (size_y & (size_y - 1)) != 0) error("Invalid map size"); |