summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-08-07 23:04:58 -0400
committerNeil Moore <neil@s-z.org>2014-08-07 23:04:58 -0400
commit353c5feaf5d9362234493de1426d2d0fb3761d16 (patch)
treec9f971310ff3731e86c60ddfcfc4be0450e0c293
parent26b2a3cc2632f3df6d7ee29dd5ca9c4bce9a5ab8 (diff)
downloadcrawl-ref-353c5feaf5d9362234493de1426d2d0fb3761d16.tar.gz
crawl-ref-353c5feaf5d9362234493de1426d2d0fb3761d16.zip
Distinguish &_junk from &_no god, and don't crash on either.
-rw-r--r--crawl-ref/source/religion.cc3
-rw-r--r--crawl-ref/source/wiz-you.cc4
2 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 9618b1c54a..195701706f 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -3729,8 +3729,7 @@ god_type choose_god()
string spec = lowercase_string(specs);
- // Skip GOD_NO_GOD
- return find_earliest_match(spec, (god_type) 1, NUM_GODS,
+ return find_earliest_match(spec, GOD_NO_GOD, NUM_GODS,
_always_true<god_type>,
bind2nd(ptr_fun(god_name), false));
}
diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc
index 9b4f20616d..0a7b8489e4 100644
--- a/crawl-ref/source/wiz-you.cc
+++ b/crawl-ref/source/wiz-you.cc
@@ -1230,7 +1230,9 @@ void wizard_load_dump_file()
void wizard_join_religion()
{
god_type god = choose_god();
- if (god == GOD_NO_GOD)
+ if (god == NUM_GODS)
+ mpr("That god doesn't seem to exist!");
+ else if (god == GOD_NO_GOD)
{
if (you_worship(GOD_NO_GOD))
mpr("You already have no god!");