summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc2
-rw-r--r--crawl-ref/source/itemname.cc15
-rw-r--r--crawl-ref/source/itemname.h13
-rw-r--r--crawl-ref/source/shopping.cc9
4 files changed, 21 insertions, 18 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 067a37f80e..d31e6446b7 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1769,7 +1769,7 @@ void process_command( command_type cmd )
break;
case CMD_DISPLAY_KNOWN_OBJECTS:
- check_item_knowledge();
+ check_item_knowledge(false);
break;
case CMD_REPLAY_MESSAGES:
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
diff --git a/crawl-ref/source/itemname.h b/crawl-ref/source/itemname.h
index b98715bcfd..a7b7bcd268 100644
--- a/crawl-ref/source/itemname.h
+++ b/crawl-ref/source/itemname.h
@@ -74,22 +74,11 @@ enum potion_description_qualifier_type
};
bool is_vowel( const char chr );
-
-/* ***********************************************************************
- * called from: debug - describe - dungeon - fight - files - item_use -
- * monstuff - mstuff2 - players - spells0
- * *********************************************************************** */
int property( const item_def &item, int prop_type );
-/* ***********************************************************************
- * called from: describe
- * *********************************************************************** */
const char* racial_description_string(const item_def& item, bool terse = false);
-/* ***********************************************************************
- * called from: acr
- * *********************************************************************** */
-void check_item_knowledge();
+bool check_item_knowledge(bool quiet);
std::string quant_name( const item_def &item, int quant,
description_level_type des, bool terse = false );
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index 70227a4f2d..9ca277ad22 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -328,7 +328,13 @@ static bool _in_a_shop( int shopidx )
int ft = get_ch();
if (ft == '\\')
- check_item_knowledge();
+ {
+ if (!check_item_knowledge(true))
+ {
+ _shop_print("You don't recognize anything yet!", 1);
+ _shop_more();
+ }
+ }
else if (ft == 'x' || ft == ESCAPE)
break;
else if (ft == '\r')
@@ -338,7 +344,6 @@ static bool _in_a_shop( int shopidx )
{
_shop_print("I'm sorry, you don't seem to have enough money.",
1);
- _shop_more();
}
else if (!total_cost)
continue;