summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemname.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-10-31 02:16:00 -0700
committerMatthew Cline <zelgadis@sourceforge.net>2009-10-31 02:16:00 -0700
commit59068ce8dae39e2f6a35861d371d0ce6b01732d9 (patch)
treed60a7415f571bc2afcdc5b377bb8bdd349408492 /crawl-ref/source/itemname.cc
parentea0a802d98e069bd95b350423546ca727c1b3a2a (diff)
downloadcrawl-ref-59068ce8dae39e2f6a35861d371d0ce6b01732d9.tar.gz
crawl-ref-59068ce8dae39e2f6a35861d371d0ce6b01732d9.zip
Auto-update shopping-list when new items seen
Automatically update the shopping list if you see the same item for less cost in another shop, or if you get an item identical to one on the shopping list (currently only applies to jewellery, books and staves).
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r--crawl-ref/source/itemname.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index db5f873da3..a0577bad38 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -37,6 +37,7 @@
#include "player.h"
#include "religion.h"
#include "quiver.h"
+#include "shopping.h"
#include "skills2.h"
#include "spl-book.h"
#include "state.h"
@@ -1813,6 +1814,9 @@ void set_ident_type( item_def &item, item_type_id_state_type setting,
item_type_id_state_type old_setting = get_ident_type(item);
set_ident_type(item.base_type, item.sub_type, setting, force);
+ if (in_inventory(item))
+ shopping_list.cull_identical_items(item);
+
if (setting == ID_KNOWN_TYPE && old_setting != ID_KNOWN_TYPE
&& notes_are_active() && is_interesting_item(item)
&& !(item.flags & (ISFLAG_NOTED_ID | ISFLAG_NOTED_GET)))