summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/goditem.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2012-07-11 10:20:48 +0200
committerRaphael Langella <raphael.langella@gmail.com>2012-07-11 10:20:48 +0200
commit0f3324d521cd2c3215d6e8114d9811b96d2573c7 (patch)
treed978f13918b1425b7d33051742cf6aabca3c8c6b /crawl-ref/source/goditem.cc
parent1cb138f46103a354a42dfa10c612926d14687286 (diff)
downloadcrawl-ref-0f3324d521cd2c3215d6e8114d9811b96d2573c7.tar.gz
crawl-ref-0f3324d521cd2c3215d6e8114d9811b96d2573c7.zip
Don't acquire items your god hates.
Since is_useless_item takes religion into account, acquirement is already affected by religion, but in an inconsistent way. For example, with TSO, invisibility is useless and poison/evil is forbidden. You can acquire the latter, but not the former, which doesn't make much sense.
Diffstat (limited to 'crawl-ref/source/goditem.cc')
-rw-r--r--crawl-ref/source/goditem.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/goditem.cc b/crawl-ref/source/goditem.cc
index 667faead99..7a1d332f4d 100644
--- a/crawl-ref/source/goditem.cc
+++ b/crawl-ref/source/goditem.cc
@@ -535,6 +535,11 @@ conduct_type god_hates_item_handling(const item_def &item)
return DID_NOTHING;
}
+bool god_hates_item(const item_def &item)
+{
+ return good_god_hates_item_handling(item) || god_hates_item_handling(item);
+}
+
bool god_dislikes_spell_type(spell_type spell, god_type god)
{
if (god_hates_spell(spell, god))