From fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7 Mon Sep 17 00:00:00 2001 From: haranp Date: Sat, 21 Apr 2007 16:18:19 +0000 Subject: Eliminated it_name(), in_name(), item_name(). The function to use is now item_def::name(). Cleaned up a lot of code in the process. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1341 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemprop.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/itemprop.cc') diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 00bef2feaa..6059fff200 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -458,17 +458,13 @@ bool item_ident( const item_def &item, unsigned long flags ) void set_ident_flags( item_def &item, unsigned long flags ) { - bool known_before = fully_identified(item); + const bool known_before = fully_identified(item); item.flags |= flags; - if ( !known_before && fully_identified(item) ) { + if ( !known_before && fully_identified(item) && is_interesting_item(item)) + { /* make a note of it */ - if ( is_interesting_item(item) ) { - char buf[ITEMNAME_SIZE]; - char buf2[ITEMNAME_SIZE]; - item_name( item, DESC_NOCAP_A, buf ); - strcpy(buf2, origin_desc(item).c_str()); - take_note(Note(NOTE_ID_ITEM, 0, 0, buf, buf2)); - } + take_note(Note(NOTE_ID_ITEM, 0, 0, item.name(DESC_NOCAP_A).c_str(), + origin_desc(item).c_str())); } } -- cgit v1.2.3-54-g00ecf