summaryrefslogtreecommitdiff
path: root/src/resources/itemdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r--src/resources/itemdb.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 5c88043ed..59d7e951c 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -151,12 +151,24 @@ void ItemDB::load()
int tagNum = 0;
logger->log1("Initializing item database...");
+ mTags.clear();
+ mTagNames.clear();
+ mTagNames.push_back("All");
+ mTagNames.push_back("Usable");
+ mTagNames.push_back("Unusable");
+ mTagNames.push_back("Equipment");
+ mTags["All"] = tagNum ++;
+ mTags["Usable"] = tagNum ++;
+ mTags["Unusable"] = tagNum ++;
+ mTags["Equipment"] = tagNum ++;
+
mUnknown = new ItemInfo;
mUnknown->setName(_("Unknown item"));
mUnknown->setDisplay(SpriteDisplay());
std::string errFile = paths.getStringValue("spriteErrorFile");
mUnknown->setSprite(errFile, GENDER_MALE);
mUnknown->setSprite(errFile, GENDER_FEMALE);
+ mUnknown->addTag(mTags["All"]);
XML::Document doc("items.xml");
xmlNodePtr rootNode = doc.rootNode();
@@ -168,17 +180,6 @@ void ItemDB::load()
return;
}
- mTags.clear();
- mTagNames.clear();
- mTagNames.push_back("All");
- mTagNames.push_back("Usable");
- mTagNames.push_back("Unusable");
- mTagNames.push_back("Equipment");
- mTags["All"] = tagNum ++;
- mTags["Usable"] = tagNum ++;
- mTags["Unusable"] = tagNum ++;
- mTags["Equipment"] = tagNum ++;
-
for_each_xml_child_node(node, rootNode)
{
if (!xmlStrEqual(node->name, BAD_CAST "item"))