diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-28 19:34:32 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-28 19:34:32 +0000 |
commit | c1a18637483787cffd4cf2cd85ced0dbfd26b1b7 (patch) | |
tree | d26e0dc30a2c9ae6faf3a6e72c2e91c3f96fe45a /crawl-ref/source/initfile.cc | |
parent | 292816a9de3eb80cee7c0feb8f02cc6069a7a718 (diff) | |
download | crawl-ref-c1a18637483787cffd4cf2cd85ced0dbfd26b1b7.tar.gz crawl-ref-c1a18637483787cffd4cf2cd85ced0dbfd26b1b7.zip |
Make include look like other options (dpeg).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5316 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r-- | crawl-ref/source/initfile.cc | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index ff2dcef9b8..496a509df3 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -1618,23 +1618,6 @@ void game_options::set_option_fragment(const std::string &s) } } -bool game_options::include_file_directive(const std::string &line, - bool runscript) -{ - const std::string prefix = "include "; - if (line.find(prefix) == std::string::npos) - return (false); - - std::string include_line = trimmed_string(line); - if (include_line.find(prefix) == 0) - { - include(trimmed_string(include_line.substr(prefix.length())), - true, runscript); - return (true); - } - return (false); -} - void game_options::read_option_line(const std::string &str, bool runscript) { #define BOOL_OPTION_NAMED(_opt_str, _opt_var) \ @@ -1689,11 +1672,6 @@ void game_options::read_option_line(const std::string &str, bool runscript) bool plus_equal = false; bool minus_equal = false; - // If the user asked us to include a file, don't try to process the line - // as an option. - if (include_file_directive(str, runscript)) - return; - const int first_equals = str.find('='); // all lines with no equal-signs we ignore @@ -1764,12 +1742,17 @@ void game_options::read_option_line(const std::string &str, bool runscript) && key != "mon_glyph" && key != "opt" && key != "option" && key != "menu_colour" && key != "menu_color" && key != "message_colour" && key != "message_color" - && key != "levels" && key != "level" && key != "entries") + && key != "levels" && key != "level" && key != "entries" + && key != "include") { lowercase( field ); } - if (key == "opt" || key == "option") + if (key == "include") + { + include(field, true, runscript); + } + else if (key == "opt" || key == "option") { split_parse(field, ",", &game_options::set_option_fragment); } |