summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/invent.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r--crawl-ref/source/invent.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 461d83bda3..057f4c8e7b 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -633,6 +633,13 @@ static bool item_class_selected(const item_def &i, int selector)
|| itype == OBJ_MISCELLANY);
case OBJ_SCROLLS:
return (itype == OBJ_SCROLLS || itype == OBJ_BOOKS);
+ case OSEL_EQUIP:
+ for (int eq = 0; eq < NUM_EQUIP; eq++)
+ {
+ if (you.equip[eq] == i.link)
+ return (true);
+ }
+ // fall through
default:
return (false);
}
@@ -913,7 +920,7 @@ bool has_warning_inscription(const item_def& item,
bool check_warning_inscriptions( const item_def& item,
operation_types oper )
{
- if ( has_warning_inscription(item, oper) )
+ if (is_valid_item( item ) && has_warning_inscription(item, oper) )
{
std::string prompt = "Really choose ";
prompt += item.name(DESC_INVENTORY);