From 038a00b2e589db2e0734a53f19c4ee88b3eeb3f6 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 17 Nov 2008 17:22:40 +0000 Subject: 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 --- crawl-ref/source/item_use.cc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'crawl-ref/source/item_use.cc') 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() +} //--------------------------------------------------------------- // -- cgit v1.2.3-54-g00ecf