From 353c5feaf5d9362234493de1426d2d0fb3761d16 Mon Sep 17 00:00:00 2001 From: Neil Moore Date: Thu, 7 Aug 2014 23:04:58 -0400 Subject: Distinguish &_junk from &_no god, and don't crash on either. --- crawl-ref/source/religion.cc | 3 +-- crawl-ref/source/wiz-you.cc | 4 +++- 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, 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!"); -- cgit v1.2.3-54-g00ecf