summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/externs.h3
-rw-r--r--crawl-ref/source/initfile.cc6
2 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 340acef5df..697ee9192a 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1887,7 +1887,8 @@ public:
unsigned int tutorial_left;
private:
- std::map<std::string, std::string> aliases;
+ typedef std::map<std::string, std::string> string_map;
+ string_map aliases;
std::set<std::string> included; // Files we've included already.
public:
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 92b230a6dc..ff2dcef9b8 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -2886,11 +2886,15 @@ void game_options::include(const std::string &rawfilename,
// Change this->filename to the included filename while we're reading it.
unwind_var<std::string> optfile(this->filename, include_file);
+
+ // Also unwind any aliases defined in included files.
+ unwind_var<string_map> unwalias(aliases);
+
FILE* f = fopen( include_file.c_str(), "r" );
if (f)
{
FileLineInput fl(f);
- read_options(fl, runscript);
+ this->read_options(fl, runscript, false);
fclose(f);
}
}