diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-07 07:51:48 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-07 07:51:48 +0000 |
commit | b58fbcfafc44bc2810863a3722bee2e6a8f7d22d (patch) | |
tree | 22a1199ad8ca845bfad04590d9dc5e9891ae8960 /crawl-ref/source/util/levcomp.ypp | |
parent | cf61c793d3d3783b2b5a39a8cf01b857806411b2 (diff) | |
download | crawl-ref-b58fbcfafc44bc2810863a3722bee2e6a8f7d22d.tar.gz crawl-ref-b58fbcfafc44bc2810863a3722bee2e6a8f7d22d.zip |
*Breaks save compatibility* - changed monster flags to long, added "god" field for future fun.
dungeon.cc cleanup and rework to support floating vaults.
Updated levcomp to support the float orientation.
coord_def now has a constructor.
USE_RIVERS and USE_NEW_UNRANDS are no longer conditional.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@585 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/util/levcomp.ypp')
-rw-r--r-- | crawl-ref/source/util/levcomp.ypp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp index e419bdc878..d5b0bb2c7f 100644 --- a/crawl-ref/source/util/levcomp.ypp +++ b/crawl-ref/source/util/levcomp.ypp @@ -28,7 +28,7 @@ void yyerror(const char *e) %token <i> NAME DEPTH ORIENT PLACE CHANCE FLAGS MONS %token <i> ROOT_DEPTH ENTRY_MSG EXIT_MSG %token <i> ROCK_COLOUR FLOOR_COLOUR -%token <i> ENCOMPASS +%token <i> ENCOMPASS FLOAT %token <i> NORTH EAST SOUTH WEST %token <i> NORTHEAST SOUTHEAST SOUTHWEST NORTHWEST @@ -71,6 +71,39 @@ defdepth : DEFAULT_DEPTH depth_range level : name metalines map_def metalines { + if (lc_map.orient == MAP_FLOAT + || lc_map.is_minivault()) + { + if (lc_map.map.width() > GXM - MAPGEN_BORDER * 2 + || lc_map.map.height() > GYM - MAPGEN_BORDER * 2) + { + char buf[300]; + snprintf(buf, sizeof buf, + "%s is too big: %dx%d - max %dx%d", + lc_map.is_minivault()? "Minivault" : "Float", + lc_map.map.width(), lc_map.map.height(), + GXM - MAPGEN_BORDER * 2, + GYM - MAPGEN_BORDER * 2); + yyerror(buf); + } + } + else + { + if (lc_map.map.width() > GXM + || lc_map.map.height() > GYM) + { + char buf[300]; + snprintf(buf, sizeof buf, + "Map is too big: %dx%d - max %dx%d", + lc_map.map.width(), lc_map.map.height(), + GXM, GYM); + yyerror(buf); + } + } + + if (lc_map.map.height() == 0) + yyerror("Must define map."); + add_parsed_map( lc_map ); } ; @@ -183,6 +216,7 @@ orient_name : ENCOMPASS { $$ = MAP_ENCOMPASS; } | SOUTHEAST { $$ = MAP_SOUTHEAST; } | SOUTHWEST { $$ = MAP_SOUTHWEST; } | NORTHWEST { $$ = MAP_NORTHWEST; } + | FLOAT { $$ = MAP_FLOAT; } ; flags : FLAGS flagnames {} |