summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-08 20:59:26 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-08 20:59:26 +0000
commitccd8ab9d731d18d9fa3d6c29ed6bb9c8ab220c5d (patch)
tree50445a3689cc911f1d28ea535a2a5a049b314e71 /crawl-ref/source/initfile.cc
parenteb6bb5f5ee6d07cdfb1b3239b155e8b252e98ae6 (diff)
downloadcrawl-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/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 73b10fc005..82d888ed4f 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -586,7 +586,7 @@ void game_options::reset_options()
prev_weapon = WPN_UNKNOWN;
prev_book = SBT_NO_SELECTION;
prev_randpick = false;
- remember_name = false;
+ remember_name = true;
#ifdef USE_ASCII_CHARACTERS
char_set = CSET_ASCII;
@@ -2548,6 +2548,7 @@ enum commandline_option_type {
CLO_SCOREFILE,
CLO_MORGUE,
CLO_MACRO,
+ CLO_MAPSTAT,
CLO_NOPS
};
@@ -2555,7 +2556,7 @@ enum commandline_option_type {
static const char *cmd_ops[] = { "scores", "name", "race", "class",
"pizza", "plain", "dir", "rc", "tscores",
"vscores", "scorefile", "morgue",
- "macro" };
+ "macro", "mapstat" };
const int num_cmd_ops = CLO_NOPS;
bool arg_seen[num_cmd_ops];
@@ -2671,6 +2672,20 @@ bool parse_args( int argc, char **argv, bool rc_only )
}
break;
+ case CLO_MAPSTAT:
+ crawl_state.map_stat_gen = true;
+ if (next_is_param)
+ {
+ SysEnv.map_gen_iters = atoi(next_arg);
+ if (SysEnv.map_gen_iters < 1)
+ SysEnv.map_gen_iters = 1;
+ else if (SysEnv.map_gen_iters > 10000)
+ SysEnv.map_gen_iters = 10000;
+ }
+ else
+ SysEnv.map_gen_iters = 100;
+ break;
+
case CLO_MACRO:
if (!next_is_param)
return (false);
@@ -2708,9 +2723,6 @@ bool parse_args( int argc, char **argv, bool rc_only )
if (!next_is_param)
return (false);
- // if (strlen(next_arg) != 1)
- // return (false);
-
if (!rc_only)
{
if (o == 2)