From b58fbcfafc44bc2810863a3722bee2e6a8f7d22d Mon Sep 17 00:00:00 2001 From: dshaligram Date: Thu, 7 Dec 2006 07:51:48 +0000 Subject: *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 --- crawl-ref/source/util/levcomp.ypp | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/util/levcomp.ypp') 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 NAME DEPTH ORIENT PLACE CHANCE FLAGS MONS %token ROOT_DEPTH ENTRY_MSG EXIT_MSG %token ROCK_COLOUR FLOOR_COLOUR -%token ENCOMPASS +%token ENCOMPASS FLOAT %token NORTH EAST SOUTH WEST %token 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 {} -- cgit v1.2.3-54-g00ecf