diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-08 20:59:26 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-08 20:59:26 +0000 |
commit | ccd8ab9d731d18d9fa3d6c29ed6bb9c8ab220c5d (patch) | |
tree | 50445a3689cc911f1d28ea535a2a5a049b314e71 /crawl-ref/source/dungeon.cc | |
parent | eb6bb5f5ee6d07cdfb1b3239b155e8b252e98ae6 (diff) | |
download | crawl-ref-ccd8ab9d731d18d9fa3d6c29ed6bb9c8ab220c5d.tar.gz crawl-ref-ccd8ab9d731d18d9fa3d6c29ed6bb9c8ab220c5d.zip |
Added debugging code to generate multiple dungeons (all branches and levels)
and gather statistics on maps used and Lua errors encountered.
To use it, run "crawl -mapstat" with a full-debug build. Output will be
mapgen.log in the current directory.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1805 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 6ef81ba2d4..b7229487e3 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -233,7 +233,7 @@ static void place_altars() /********************************************************************** * builder() - kickoff for the dungeon generator. *********************************************************************/ -void builder(int level_number, int level_type) +bool builder(int level_number, int level_type) { // N tries to build the level, after which we bail with a capital B. int tries = 20; @@ -243,13 +243,17 @@ void builder(int level_number, int level_type) build_dungeon_level(level_number, level_type); if (!dgn_level_vetoed && valid_dungeon_level(level_number, level_type)) - return; + return (true); } - // Failed to build level, bail out. - save_game(true, - make_stringf("Unable to generate level for '%s'!", - level_id::current().describe().c_str()).c_str()); + if (!crawl_state.map_stat_gen) + { + // Failed to build level, bail out. + save_game(true, + make_stringf("Unable to generate level for '%s'!", + level_id::current().describe().c_str()).c_str()); + } + return (false); } static void mask_vault(const vault_placement &place, unsigned mask) |