summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-17 22:30:02 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-17 22:30:02 +0000
commite39198243f99fae49befe7489b3f16ad6556b835 (patch)
tree88a872fcf264d37908c7820ace37486b842da542
parent48b1b54aaf8c7ccc2b016158f58cf34385dd5068 (diff)
downloadcrawl-ref-e39198243f99fae49befe7489b3f16ad6556b835.tar.gz
crawl-ref-e39198243f99fae49befe7489b3f16ad6556b835.zip
Fixed -morgue option being ignored when Crawl is built with Lua bindings (Marc).
Dropped generation odds of Pan demons post-Orb. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2011 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/chardump.cc1
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/initfile.cc10
-rw-r--r--crawl-ref/source/monplace.cc2
4 files changed, 9 insertions, 5 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index 86104c5cc1..1805077d84 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -827,6 +827,7 @@ const char *hunger_level(void)
static std::string morgue_directory()
{
std::string dir =
+ !SysEnv.morgue_dir.empty() ? SysEnv.morgue_dir :
!Options.morgue_dir.empty()? Options.morgue_dir :
!SysEnv.crawl_dir.empty() ? SysEnv.crawl_dir : "";
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index fe553974a4..e38f79546d 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1396,6 +1396,7 @@ struct system_environment
std::string crawl_pizza;
std::string crawl_rc;
std::string crawl_dir;
+ std::string morgue_dir;
std::string crawl_base; // Directory from argv[0], may be used to
// locate datafiles.
std::string home; // only used by MULTIUSER systems
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index c7c762b932..e084e3d546 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -530,7 +530,7 @@ void game_options::reset_options()
save_dir.clear();
#endif
-#ifndef SHORT_FILE_NAMES
+#if !defined(SHORT_FILE_NAMES) && !defined(SAVE_DIR_PATH)
morgue_dir = "morgue/";
#endif
@@ -1870,22 +1870,24 @@ void game_options::read_option_line(const std::string &str, bool runscript)
{
remember_name = read_bool( field, remember_name );
}
+#ifndef SAVE_DIR_PATH
else if (key == "save_dir")
{
// If SAVE_DIR_PATH was defined, there are very likely security issues
// with allowing the user to specify a different directory.
-#ifndef SAVE_DIR_PATH
save_dir = field;
-#endif
}
+#endif
else if (key == "show_turns")
{
show_turns = read_bool( field, show_turns );
}
+#ifndef SAVE_DIR_PATH
else if (key == "morgue_dir")
{
morgue_dir = field;
}
+#endif
else if (key == "hp_warning")
{
hp_warning = atoi( field.c_str() );
@@ -2785,7 +2787,7 @@ bool parse_args( int argc, char **argv, bool rc_only )
if (!next_is_param)
return (false);
if (!rc_only)
- Options.morgue_dir = next_arg;
+ SysEnv.morgue_dir = next_arg;
nextUsed = true;
break;
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 5e687fe4fb..348f3bc666 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -1342,7 +1342,7 @@ void mark_interesting_monst(struct monsters* monster, beh_type behaviour)
static int pick_zot_exit_defender()
{
- if (one_chance_in(9))
+ if (one_chance_in(11))
return (MONS_PANDEMONIUM_DEMON);
const int temp_rand = random2(276);