summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 6e4cde4035..b2605acc73 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -550,6 +550,10 @@ void game_options::reset_options()
player_name.clear();
+#ifdef SIMPLE_MESSAGING
+ messaging = true;
+#endif
+
autopickup_on = true;
autoprayer_on = false;
@@ -1824,7 +1828,13 @@ void game_options::read_option_line(const std::string &str, bool runscript)
else if (key == "autopickup_no_burden")
{
autopickup_no_burden = read_bool( field, autopickup_no_burden );
- }
+ }
+#ifdef SIMPLE_MESSAGING
+ else if (key == "messaging")
+ {
+ messaging = read_bool(field, messaging);
+ }
+#endif
else if (key == "use_notes")
{
use_notes = read_bool( field, use_notes );
@@ -2362,6 +2372,16 @@ void get_system_environment(void)
// This should end with the appropriate path delimiter.
SysEnv.crawl_dir = getenv("CRAWL_DIR");
+#ifdef SIMPLE_MESSAGING
+ // Enable SIMPLE_MESSAGING only if SIMPLEMAIL and MAIL are set.
+ const char *simplemail = getenv("SIMPLEMAIL");
+ if (simplemail && strcmp(simplemail, "0"))
+ {
+ const char *mail = getenv("MAIL");
+ SysEnv.messagefile = mail? mail : "";
+ }
+#endif
+
// The full path to the init file -- this over-rides CRAWL_DIR
SysEnv.crawl_rc = getenv("CRAWL_RC");