summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-20 11:47:37 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-20 11:47:37 +0000
commit6052fa93471180670f18d1abad16b2a12cdcf1dc (patch)
treec6eab06e95c6c8d643990cb4e660b5fccd08c9cd /crawl-ref/source/items.cc
parentb926fb5cd10ca674313c3b8aa2bf99d6233db143 (diff)
downloadcrawl-ref-6052fa93471180670f18d1abad16b2a12cdcf1dc.tar.gz
crawl-ref-6052fa93471180670f18d1abad16b2a12cdcf1dc.zip
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
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc22
1 files changed, 17 insertions, 5 deletions
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<object_class_type>(i),
max_subtype[i], name))
+ {
break;
+ }
}
}
else