From 80c7baf5a9d6beab424479c2295d4a52b1ed757b Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 8 Feb 2009 16:02:03 +0000 Subject: [2577409]: minor improvements to the shopping interface. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8979 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemname.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/itemname.cc') diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 9098999a0f..f63fe61e5c 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -1892,9 +1892,10 @@ bool item_names( const item_def *it1, < it2->name(DESC_PLAIN, false, false, false); } -void check_item_knowledge() +bool check_item_knowledge(bool quiet) { std::vector items; + bool rc = true; const object_class_type idx_to_objtype[5] = { OBJ_WANDS, OBJ_SCROLLS, OBJ_JEWELLERY, OBJ_POTIONS, @@ -1902,6 +1903,7 @@ void check_item_knowledge() const int idx_to_maxtype[5] = { NUM_WANDS, NUM_SCROLLS, NUM_JEWELLERY, NUM_POTIONS, NUM_STAVES }; + for (int i = 0; i < 5; i++) { for (int j = 0; j < idx_to_maxtype[i]; j++) @@ -1922,9 +1924,14 @@ void check_item_knowledge() } if (items.empty()) - mpr("You don't recognise anything yet!"); + { + rc = false; + if (!quiet) + mpr("You don't recognise anything yet!"); + } else { + rc = true; std::sort(items.begin(), items.end(), item_names); InvMenu menu; menu.set_title("You recognise:"); @@ -1937,7 +1944,9 @@ void check_item_knowledge() iter != items.end(); ++iter ) delete *iter; } -} // end check_item_knowledge() + + return (rc); +} // Used for: Pandemonium demonlords, shopkeepers, scrolls, random artefacts -- cgit v1.2.3-54-g00ecf