summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-17 17:22:40 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-17 17:22:40 +0000
commit038a00b2e589db2e0734a53f19c4ee88b3eeb3f6 (patch)
tree174652a769840025590e946a90778aa0f201ccfa /crawl-ref/source/item_use.cc
parent87ebfe98030055b438a5bf1d6638499263bec84b (diff)
downloadcrawl-ref-038a00b2e589db2e0734a53f19c4ee88b3eeb3f6.tar.gz
crawl-ref-038a00b2e589db2e0734a53f19c4ee88b3eeb3f6.zip
Fix identification of weapons. Without this, you could e.g. take an
non-artefact uncursed blowgun off a kobold, wield it to know its curse status and type, auto-identify its pluses after using it for awhile, and an identify scroll would still see it as unidentified because the ISFLAG_KNOW_PROPERTIES flag wasn't set. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7459 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index e4ef7f2997..e3fab070c6 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -478,6 +478,7 @@ void wield_effects(int item_wield_2, bool showMsgs)
unsigned char i_dam = 0;
item_def &item = you.inv[item_wield_2];
+ const bool artefact = is_random_artefact(item);
const bool known_cursed = item_known_cursed(item);
// And here we finally get to the special effects of wielding. {dlb}
@@ -533,19 +534,16 @@ void wield_effects(int item_wield_2, bool showMsgs)
// (could be extended to other talking weapons...)
const std::string old_desc = item.name(DESC_CAP_THE);
- if (!was_known)
- {
- if (is_random_artefact(item))
- item.flags |= ISFLAG_NOTED_ID;
- set_ident_flags(item, ISFLAG_EQ_WEAPON_MASK);
- }
+ set_ident_flags(item, ISFLAG_EQ_WEAPON_MASK);
- if (is_random_artefact(item))
+ if (artefact)
{
i_dam = randart_wpn_property(item, RAP_BRAND);
use_randart(item_wield_2);
if (!was_known)
{
+ item.flags |= ISFLAG_NOTED_ID;
+
if (Options.autoinscribe_randarts)
add_autoinscription(item, randart_auto_inscription(item));
@@ -765,8 +763,6 @@ void wield_effects(int item_wield_2, bool showMsgs)
xom_is_stimulated(64);
}
- // Give curse status when wielded.
- set_ident_flags( item, ISFLAG_KNOW_CURSE );
break;
}
default:
@@ -777,7 +773,7 @@ void wield_effects(int item_wield_2, bool showMsgs)
warn_shield_penalties();
you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = 0;
-} // end wield_weapon()
+}
//---------------------------------------------------------------
//