(svn r16603) -Codechange: enumify map size limits (based on a patch by Bilbo)

This commit is contained in:
smatz
2009-06-20 11:25:39 +00:00
parent 88ec646c1f
commit 4419366f94
4 changed files with 14 additions and 5 deletions

View File

@@ -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");