From 4419366f94f75032b53362e2722b6476beb02866 Mon Sep 17 00:00:00 2001 From: smatz Date: Sat, 20 Jun 2009 11:25:39 +0000 Subject: (svn r16603) -Codechange: enumify map size limits (based on a patch by Bilbo) --- src/map.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/map.cpp') 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"); -- cgit v1.2.3-54-g00ecf