summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/acr.cc5
-rw-r--r--crawl-ref/source/itemname.cc16
-rw-r--r--crawl-ref/source/stash.cc3
3 files changed, 23 insertions, 1 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 271cb3b6e3..f75e07ae88 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -3819,6 +3819,11 @@ static bool _initialise(void)
init_spell_descs(); // This needs to be way up top. {dlb}
init_mon_name_cache();
+ // init_item_name_cache() needs to be redone after init_char_table()
+ // and init_feature_table() have been called, so that the glyphs will
+ // be set to use with item_names_by_glyph_cache.
+ init_item_name_cache();
+
msg::initialise_mpr_streams();
// Init item array.
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index bd5149d314..d682c92f65 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -2715,6 +2715,9 @@ void init_item_name_cache()
-1
};
+ item_names_cache.clear();
+ item_names_by_glyph_cache.clear();
+
for (int i = 0; sub_type_limits[i] != -1; i++)
{
object_class_type base_type = static_cast<object_class_type>(i);
@@ -2722,6 +2725,16 @@ void init_item_name_cache()
for (unsigned char sub_type = 0; sub_type < num_sub_types; sub_type++)
{
+ if (base_type == OBJ_BOOKS)
+ {
+ if (sub_type == BOOK_RANDART_LEVEL
+ || sub_type == BOOK_RANDART_THEME)
+ {
+ // These are randart only and have no fixed names.
+ continue;
+ }
+ }
+
int o = items(0, base_type, sub_type, true, 1,
MAKE_ITEM_NO_RACE);
@@ -2754,7 +2767,8 @@ void init_item_name_cache()
if (item_names_cache.find(name) == item_names_cache.end())
{
item_names_cache[name] = pair;
- item_names_by_glyph_cache[glyph].push_back(name);
+ if (glyph)
+ item_names_by_glyph_cache[glyph].push_back(name);
}
}
}
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index 76f4884a2a..039286565f 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -29,6 +29,7 @@
#include "notes.h"
#include "overmap.h"
#include "place.h"
+#include "randart.h"
#include "shopping.h"
#include "spl-book.h"
#include "stash.h"
@@ -227,6 +228,8 @@ bool Stash::is_filtered(const item_def &item)
&& (filter.sub_type == 255
|| item.sub_type == filter.sub_type))
{
+ if (is_artefact(item))
+ return (false);
if (filter.sub_type != 255 && !item_type_known(item))
return (false);
return (true);