diff options
-rw-r--r-- | crawl-ref/source/AppHdr.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/macro.cc | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index 3de9c17a70..8bad5c10e4 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -227,6 +227,10 @@ // Uses <playername>-macro.txt as the macro file if uncommented. // #define DGL_NAMED_MACRO_FILE + + // Uses Options.macro_dir as the full path to the macro file. Mutually + // exclusive with DGL_NAMED_MACRO_FILE. + #define DGL_MACRO_ABSOLUTE_PATH #endif // ========================================================================= diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index 3a14a0c4ef..2420971a40 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -175,15 +175,19 @@ static std::string get_macro_file() if (!dir.empty()) { +#ifndef DGL_MACRO_ABSOLUTE_PATH if (dir[dir.length() - 1] != FILE_SEPARATOR) dir += FILE_SEPARATOR; +#endif } -#ifdef DGL_NAMED_MACRO_FILE +#if defined(DGL_MACRO_ABSOLUTE_PATH) + return (dir.empty()? "macro.txt" : dir); +#elif defined(DGL_NAMED_MACRO_FILE) return (dir + strip_filename_unsafe_chars(you.your_name) + "-macro.txt"); #else return (dir + "macro.txt"); -#endif +#endif } static void buf2keyseq(const char *buff, keyseq &k) |