summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemname.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-08 16:02:03 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-08 16:02:03 +0000
commit80c7baf5a9d6beab424479c2295d4a52b1ed757b (patch)
tree788d671ee7d55f173c4494b0037b6c48b77ebab0 /crawl-ref/source/itemname.cc
parentbc14cb50b1c005ffa4442fb2f59c9e7fb74b1dd2 (diff)
downloadcrawl-ref-80c7baf5a9d6beab424479c2295d4a52b1ed757b.tar.gz
crawl-ref-80c7baf5a9d6beab424479c2295d4a52b1ed757b.zip
[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
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r--crawl-ref/source/itemname.cc15
1 files changed, 12 insertions, 3 deletions
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<const item_def*> 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