summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/settings/init.txt4
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/initfile.cc31
3 files changed, 9 insertions, 27 deletions
diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt
index a681776195..5225d8c635 100644
--- a/crawl-ref/settings/init.txt
+++ b/crawl-ref/settings/init.txt
@@ -9,7 +9,7 @@
# The options for monster glyphs and item colours don't matter for Tiles.
# (New players should just ignore these lines.)
#
-# include 034_monster_glyphs.txt
+# include = 034_monster_glyphs.txt
# additional_macro_file = 034_command_keys.txt
# classic_item_colours = true
# classic_hud = true
@@ -185,7 +185,7 @@ trapwalk_safe_hp = dart:20,needle:15,arrow:35,bolt:45,spear:40,axe:45,blade:95
# warrant your attention. This file (travel_stoppers.txt) contains a list of
# travel_stop_message settings, with brief descriptions of what they do.
-include travel_stoppers.txt
+include = travel_stoppers.txt
##### 4-h Stashes ###############################
#
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 697ee9192a..eb1062167b 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1940,7 +1940,6 @@ private:
void add_mon_glyph_override(const std::string &);
mon_display parse_mon_glyph(const std::string &s) const;
void set_option_fragment(const std::string &s);
- bool include_file_directive(const std::string &line, bool runscript);
static const std::string interrupt_prefix;
};
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);
}