summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/goditem.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2013-05-18 14:04:18 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2013-05-18 14:10:06 -0600
commitd329f00be8647fde267df9a593258f771aa1fc3f (patch)
tree5ddbeef16ded95def6931a5da16c70cbb455d87b /crawl-ref/source/goditem.cc
parent862d934b2900b5bfee204044ada29dbdf718adca (diff)
downloadcrawl-ref-d329f00be8647fde267df9a593258f771aa1fc3f.tar.gz
crawl-ref-d329f00be8647fde267df9a593258f771aa1fc3f.zip
Try especially hard to not acquire god-hated items (#5627, #6631).
A lot of checking for god-hated items depends on the type of the item being known; in addition to adding in one last check for uselessness / god-hatedness, this temporarily marks the type as known for the purpose of determining if an acquired item is a god-hated item. This also fixes an infinite loop when trying to generate a weapon whose only eligible good brand is holy wrath where holy wrath is not wieldable by the player.
Diffstat (limited to 'crawl-ref/source/goditem.cc')
-rw-r--r--crawl-ref/source/goditem.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/crawl-ref/source/goditem.cc b/crawl-ref/source/goditem.cc
index 1fe235f7e5..7de56b33de 100644
--- a/crawl-ref/source/goditem.cc
+++ b/crawl-ref/source/goditem.cc
@@ -538,7 +538,8 @@ conduct_type god_hates_item_handling(const item_def &item)
bool god_hates_item(const item_def &item)
{
- return good_god_hates_item_handling(item) || god_hates_item_handling(item);
+ return (good_god_hates_item_handling(item) != DID_NOTHING)
+ || (god_hates_item_handling(item) != DID_NOTHING);
}
bool god_dislikes_spell_type(spell_type spell, god_type god)