summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
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);