summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/invent.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-17 21:41:30 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-17 21:41:30 +0000
commit720441b258f72f676ff59aca61ec2392cb629d07 (patch)
tree27bacb105414b1f2acfc001961d80f52b8c1adb1 /crawl-ref/source/invent.cc
parentce9f50e78b9bf225a0e9960ad87e03ac78bb5dde (diff)
downloadcrawl-ref-720441b258f72f676ff59aca61ec2392cb629d07.tar.gz
crawl-ref-720441b258f72f676ff59aca61ec2392cb629d07.zip
Refix for 1719721: what I thought was a simple fix in InvEntry turned
out to be a bug...We might want a 'bool inv_prefix' argument to name(), or an appropriate description_type. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1479 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r--crawl-ref/source/invent.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 121768c4d7..18773c5643 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -61,7 +61,16 @@ std::string InvTitle::get_text() const
InvEntry::InvEntry( const item_def &i ) : MenuEntry( "", MEL_ITEM ), item( &i )
{
data = const_cast<item_def *>( item );
- text = i.name(DESC_NOCAP_A, false);
+
+ if ( in_inventory(i) && i.base_type != OBJ_GOLD )
+ {
+ // We need to do this in order to get the 'wielded' annotation.
+ // We then toss out the first four characters, which look
+ // like this: "a - ". Ow. FIXME.
+ text = i.name(DESC_INVENTORY_EQUIP, false).substr(4);
+ }
+ else
+ text = i.name(DESC_NOCAP_A, false);
if (i.base_type != OBJ_GOLD && in_inventory(i))
add_hotkey(index_to_letter( i.link ));