summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-15 11:26:00 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-15 11:26:00 +0000
commitdd6871b0fbac350ea175d88e5b2bc340a5fb6e30 (patch)
treea5d03236d042f9c52c095304f74a323452d82778 /crawl-ref/source/initfile.cc
parent80ff6b26122857839ec18211fae01b734618fd34 (diff)
downloadcrawl-ref-dd6871b0fbac350ea175d88e5b2bc340a5fb6e30.tar.gz
crawl-ref-dd6871b0fbac350ea175d88e5b2bc340a5fb6e30.zip
Added -morgue option to specify where morgues are saved.
Added -macro option to specify location of macro file. Morgue files are named morgue-<cname>-<time>.txt, provided Crawl is compiled without SHORT_FILE_NAMES. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@637 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc28
1 files changed, 24 insertions, 4 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index d5d0a7abc9..2476147206 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -1153,7 +1153,8 @@ void game_options::read_options(InitLineInput &il, bool runscript)
Options.explore_stop |= Options.explore_stop_prompt;
// Validate save_dir
- check_savedir(save_dir);
+ if (!check_dir("Save directory", save_dir))
+ exit(1);
}
static int str_to_killcategory(const std::string &s)
@@ -1607,7 +1608,7 @@ void game_options::read_option_line(const std::string &str, bool runscript)
else if (key == "remember_name")
{
remember_name = read_bool( field, remember_name );
- }
+ }
else if (key == "save_dir")
{
// If SAVE_DIR_PATH was defined, there are very likely security issues
@@ -1640,7 +1641,7 @@ void game_options::read_option_line(const std::string &str, bool runscript)
}
else if (key == "note_hp_percent")
{
- note_hp_percent = atoi( field.c_str() );
+ note_hp_percent = atoi( field.c_str() );
if (note_hp_percent < 0 || note_hp_percent > 100)
{
note_hp_percent = 0;
@@ -2214,13 +2215,16 @@ enum commandline_option_type {
CLO_TSCORES,
CLO_VSCORES,
CLO_SCOREFILE,
+ CLO_MORGUE,
+ CLO_MACRO,
CLO_NOPS
};
static const char *cmd_ops[] = { "scores", "name", "race", "class",
"pizza", "plain", "dir", "rc", "tscores",
- "vscores", "scorefile" };
+ "vscores", "scorefile", "morgue",
+ "macro" };
const int num_cmd_ops = CLO_NOPS;
bool arg_seen[num_cmd_ops];
@@ -2319,6 +2323,22 @@ bool parse_args( int argc, char **argv, bool rc_only )
}
break;
+ case CLO_MACRO:
+ if (!next_is_param)
+ return (false);
+ if (!rc_only)
+ SysEnv.macro_file = next_arg;
+ nextUsed = true;
+ break;
+
+ case CLO_MORGUE:
+ if (!next_is_param)
+ return (false);
+ if (!rc_only)
+ SysEnv.morgue_dir = next_arg;
+ nextUsed = true;
+ break;
+
case CLO_SCOREFILE:
if (!next_is_param)
return (false);