diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-29 07:23:23 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-29 07:23:23 +0000 |
commit | 8ba5a61e227721c64a77d4811735e378218eb0d4 (patch) | |
tree | 4118f94b1ca291a1b113a0c77a35289a91b2bd7a /crawl-ref/source/macro.cc | |
parent | c714dc52a577aad6a815f5b4372988821bd360a3 (diff) | |
download | crawl-ref-8ba5a61e227721c64a77d4811735e378218eb0d4.tar.gz crawl-ref-8ba5a61e227721c64a77d4811735e378218eb0d4.zip |
Added morgue_dir as an init.txt option.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@718 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/macro.cc')
-rw-r--r-- | crawl-ref/source/macro.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index 9a80fe032a..2e322e4143 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -170,11 +170,17 @@ static int userfunc_getindex(const std::string &fname) */ static std::string get_macro_file() { - if (SysEnv.macro_file.length()) - return (SysEnv.macro_file); + std::string dir = + !Options.macro_dir.empty()? Options.macro_dir : + SysEnv.crawl_dir? SysEnv.crawl_dir : ""; - std::string s = SysEnv.crawl_dir? SysEnv.crawl_dir : ""; - return (s + "macro.txt"); + if (!dir.empty()) + { + if (dir[dir.length() - 1] != FILE_SEPARATOR) + dir += FILE_SEPARATOR; + } + + return (dir + "macro.txt"); } static void buf2keyseq(const char *buff, keyseq &k) |