diff options
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r-- | crawl-ref/source/itemname.cc | 15 |
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 |