diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-14 23:58:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-14 23:58:36 +0300 |
commit | 01225e88d67d0bb5abb264fff2e2eddbb3d7c4bd (patch) | |
tree | 211835f49d7de21af50ccccacbfdc36d5b8cf8aa /src/resources/itemdb.cpp | |
parent | ee1cf2a5961eb9a4006d7afd0794e8d38b59ac7b (diff) | |
download | manaverse-01225e88d67d0bb5abb264fff2e2eddbb3d7c4bd.tar.gz manaverse-01225e88d67d0bb5abb264fff2e2eddbb3d7c4bd.tar.bz2 manaverse-01225e88d67d0bb5abb264fff2e2eddbb3d7c4bd.tar.xz manaverse-01225e88d67d0bb5abb264fff2e2eddbb3d7c4bd.zip |
Add all tag to unknown items. Allow see unknown items in inventory.
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r-- | src/resources/itemdb.cpp | 23 |
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")) |