From 6052fa93471180670f18d1abad16b2a12cdcf1dc Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 20 May 2008 11:47:37 +0000 Subject: Finally fix 1868761: Books in shops being noted as identified over and over again (when searching stashes). Also remove my recently added NOTE_FOUND_ORB_OR_RUNES in favour of the previously existing NOTE_GET_ITEM. Also I've noticed that this is probably already listed in the "milestones" - but what on earth are they? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5150 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/items.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/items.cc') diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index eabb7fab8b..7652cff35d 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -970,7 +970,7 @@ static void check_note_item(item_def &item) // If it's already fully identified when picked up, don't take // further notes. - if ( fully_identified(item) ) + if (fully_identified(item)) item.flags |= ISFLAG_NOTED_ID; } } @@ -1448,8 +1448,13 @@ static void _got_item(item_def& item, int quant) } item.flags |= ISFLAG_BEEN_IN_INV; - take_note(Note(NOTE_FOUND_ORB_OR_RUNE, 0, 0, - item.name(DESC_NOCAP_A).c_str())); + if (!(item.flags & ISFLAG_NOTED_GET)) + { + take_note(Note(NOTE_GET_ITEM, 0, 0, + item.name(DESC_NOCAP_A).c_str())); + // Don't take another note. + item.flags |= (ISFLAG_NOTED_ID | ISFLAG_NOTED_GET); + } } // Returns quantity of items moved into player's inventory and -1 if @@ -1610,8 +1615,12 @@ int move_item_to_player( int obj, int quant_got, bool quiet ) && you.char_direction == GDT_DESCENDING) { // Take a note! - take_note(Note(NOTE_FOUND_ORB_OR_RUNE, 0, 0, - item.name(DESC_NOCAP_A).c_str())); + if (!(item.flags & ISFLAG_NOTED_GET)) + { + take_note(Note(NOTE_GET_ITEM, 0, 0, + item.name(DESC_NOCAP_A).c_str())); + item.flags |= (ISFLAG_NOTED_ID | ISFLAG_NOTED_GET); + } if (!quiet) mpr("Now all you have to do is get back out of the dungeon!"); @@ -2409,9 +2418,12 @@ item_def find_item_type(object_class_type base_type, std::string name) { if (!max_subtype[i]) continue; + if (find_subtype_by_name(item, static_cast(i), max_subtype[i], name)) + { break; + } } } else -- cgit v1.2.3-54-g00ecf