summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-08-02 11:02:51 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-08-02 11:10:11 -0700
commit0f053f10eb5bf6e8df296044933b8f82496ce8d3 (patch)
tree2ee23a7eea5d4f23736aa40a7e1318c5ac13ca63
parent8064468542592958c6ace5dc27aa0fd88cce04a9 (diff)
downloadcrawl-ref-0f053f10eb5bf6e8df296044933b8f82496ce8d3.tar.gz
crawl-ref-0f053f10eb5bf6e8df296044933b8f82496ce8d3.zip
Don't display disabled gods in the ?/ list
-rw-r--r--crawl-ref/source/command.cc3
-rw-r--r--crawl-ref/source/religion.cc18
-rw-r--r--crawl-ref/source/religion.h1
3 files changed, 16 insertions, 6 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 590b17f9c6..82f8485588 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -869,7 +869,8 @@ static vector<string> _get_god_keys()
for (int i = GOD_NO_GOD + 1; i < NUM_GODS; i++)
{
god_type which_god = static_cast<god_type>(i);
- names.push_back(god_name(which_god));
+ if (!is_disabled_god(which_god))
+ names.push_back(god_name(which_god));
}
return names;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 7a4fdd3abe..7ed852f21b 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -541,12 +541,23 @@ bool is_unknown_god(god_type god)
return god == GOD_NAMELESS;
}
+/**
+ * Has the god been disabled in the current version of the game?
+ *
+ * @param god The type of god in question.
+ * @return Whether the god has been disabled.
+ */
+bool is_disabled_god(god_type god)
+{
+ return god == GOD_GOZAG && Version::ReleaseType != VER_ALPHA;
+}
+
bool is_unavailable_god(god_type god)
{
if (god == GOD_JIYVA && jiyva_is_dead())
return true;
- if (god == GOD_GOZAG && Version::ReleaseType != VER_ALPHA)
+ if (is_disabled_god(god))
return true;
// Don't allow Fedhas in ZotDef, as his invocations are duplicated, and
@@ -4518,7 +4529,7 @@ static bool _is_god(god_type god)
static bool _is_temple_god(god_type god)
{
- if (!_is_god(god))
+ if (!_is_god(god) || is_disabled_god(god))
return false;
switch (god)
@@ -4529,9 +4540,6 @@ static bool _is_temple_god(god_type god)
case GOD_JIYVA:
return false;
- case GOD_GOZAG:
- return Version::ReleaseType == VER_ALPHA;
-
default:
return true;
}
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index f38b56a1d1..cc6525c087 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -25,6 +25,7 @@ bool is_good_god(god_type god);
bool is_chaotic_god(god_type god);
bool is_unknown_god(god_type god);
+bool is_disabled_god(god_type god);
// Returns true if the god is not present in the current game. This is
// orthogonal to whether the player can worship the god in question.
bool is_unavailable_god(god_type god);