From 59068ce8dae39e2f6a35861d371d0ce6b01732d9 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sat, 31 Oct 2009 02:16:00 -0700 Subject: 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). --- crawl-ref/source/itemname.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crawl-ref/source/itemname.cc') 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))) -- cgit v1.2.3-54-g00ecf