From b3a157e60e8c01aae3827e35e49306d775ea85d1 Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 30 Sep 2008 02:23:45 +0000 Subject: Mark quivered items as equipped (interface only, not gameplay.) FR 2059687. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7071 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemname.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/itemname.cc') diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index d8ab01f143..2d44e0a951 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -195,15 +195,11 @@ std::string item_def::name(description_level_type descrip, if (this->link == you.equip[EQ_WEAPON]) { - if (you.inv[ you.equip[EQ_WEAPON] ].base_type == OBJ_WEAPONS - || item_is_staff( you.inv[ you.equip[EQ_WEAPON] ] )) - { + if (this->base_type == OBJ_WEAPONS || item_is_staff(*this)) buff << " (weapon)"; - } else - { buff << " (in hand)"; - } + equipped = true; } else if (this->link == you.equip[EQ_CLOAK] @@ -231,12 +227,17 @@ std::string item_def::name(description_level_type descrip, buff << " (around neck)"; equipped = true; } + else if (this->link == you.m_quiver->get_fire_item(NULL)) + { + buff << " (quivered)"; + equipped = true; // well, sort of + } } if (descrip != DESC_BASENAME) { const bool tried = !ident && !equipped && item_type_tried(*this); - std::string tried_str = ""; + std::string tried_str; if (tried) { @@ -2627,12 +2628,17 @@ const std::string menu_colour_item_prefix(const item_def &item, bool temp) case OBJ_WEAPONS: case OBJ_ARMOUR: case OBJ_JEWELLERY: - if (item_is_equipped(item)) + if (item_is_equipped(item, true)) prefixes.push_back("equipped"); if (is_artefact(item)) prefixes.push_back("artefact"); break; + case OBJ_MISSILES: + if (item_is_equipped(item, true)) + prefixes.push_back("equipped"); + break; + default: break; } -- cgit v1.2.3-54-g00ecf