diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-01 11:19:26 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-01 11:19:26 +0000 |
commit | 2b3c8ea80b120c791882a8391292dbdec5333664 (patch) | |
tree | 842d034411b9758ab774763f491f2129429bfa39 /crawl-ref/source/mapdef.cc | |
parent | 5e974fc5a77504a7af9b6ee35d4a8fe19f8ef0c3 (diff) | |
download | crawl-ref-2b3c8ea80b120c791882a8391292dbdec5333664.tar.gz crawl-ref-2b3c8ea80b120c791882a8391292dbdec5333664.zip |
Level updates collated by David.
Fixed DEPTH: not being read correctly, added more map validation.
Increased attack speed of ice statues.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1704 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r-- | crawl-ref/source/mapdef.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 0a8c339c88..a4238facf4 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -1228,6 +1228,29 @@ std::string map_def::validate_map_def() if (map.height() == 0) return ("Must define map."); + switch (orient) + { + case MAP_NORTH: case MAP_SOUTH: + if (map.height() >= GYM * 2 / 3) + return make_stringf("Map too large - height %d (max %d)", + map.height(), GYM * 2 / 3); + break; + case MAP_EAST: case MAP_WEST: + if (map.width() >= GXM * 2 / 3) + return make_stringf("Map too large - width %d (max %d)", + map.width(), GXM * 2 / 3); + break; + case MAP_NORTHEAST: case MAP_SOUTHEAST: + case MAP_NORTHWEST: case MAP_SOUTHWEST: + if (map.width() >= GXM * 2 / 3 || map.height() > GYM * 2 / 3) + return make_stringf("Map too large - %dx%d (max %dx%d)", + map.width(), map.height(), + GXM * 2 / 3, GYM * 2 / 3); + break; + default: + break; + } + return (map.apply_transforms()); } |