summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-06-07 00:03:15 -0400
committerNeil Moore <neil@s-z.org>2014-06-07 00:34:49 -0400
commit2a59467bad1e42854f2defd6f7c9e05c98cfb553 (patch)
tree4e40126f4cee2a6605ab4b4c6e2c087ee8c24127 /crawl-ref/source/itemprop.cc
parente7fd3a97691581ed34a0a58f2e043131960e64e0 (diff)
downloadcrawl-ref-2a59467bad1e42854f2defd6f7c9e05c98cfb553.tar.gz
crawl-ref-2a59467bad1e42854f2defd6f7c9e05c98cfb553.zip
Fix some infelicities in armour enchantability check.
There was an info leak similar to the one fixed in the previous commit, but it was masked by the fact that unidentified randarts claimed to be enchantable even ignoring cursedness.
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 3cb32e9af7..f31f784695 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -1198,16 +1198,19 @@ bool is_enchantable_armour(const item_def &arm, bool uncurse, bool unknown)
return false;
// If we don't know the plusses, assume enchanting is possible.
- if (unknown && !is_known_artefact(arm)
- && !item_ident(arm, ISFLAG_KNOW_PLUSES))
- {
+ if (unknown && !is_artefact(arm) && !item_ident(arm, ISFLAG_KNOW_PLUSES))
return true;
- }
// Artefacts or highly enchanted armour cannot be enchanted, only
// uncursed.
if (is_artefact(arm) || arm.plus >= armour_max_enchant(arm))
- return uncurse && arm.cursed() && !you_worship(GOD_ASHENZARI);
+ {
+ if (!uncurse || you_worship(GOD_ASHENZARI))
+ return false;
+ if (unknown && !item_ident(arm, ISFLAG_KNOW_CURSE))
+ return true;
+ return arm.cursed();
+ }
return true;
}