summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-11 03:40:57 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-11 03:40:57 +0200
commitd3e3789ee54b7390b870a286c0bd7d74702a2aa2 (patch)
tree83635781f8a35926884504ff11311147f20cd1ac /src/resources
parent987120463333c3e412927e49234173de0b894490 (diff)
downloadmv-d3e3789ee54b7390b870a286c0bd7d74702a2aa2.tar.gz
mv-d3e3789ee54b7390b870a286c0bd7d74702a2aa2.tar.bz2
mv-d3e3789ee54b7390b870a286c0bd7d74702a2aa2.tar.xz
mv-d3e3789ee54b7390b870a286c0bd7d74702a2aa2.zip
Add support for reading cutom tags from items.xml
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/itemdb.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index a590dcac1..49ba7bd9e 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -210,6 +210,11 @@ void ItemDB::load()
std::string drawBefore = XML::getProperty(node, "drawBefore", "");
std::string drawAfter = XML::getProperty(node, "drawAfter", "");
+ std::string tags[3];
+ tags[0] = XML::getProperty(node, "tag", XML::getProperty(node, "tag1", ""));
+ tags[1] = XML::getProperty(node, "tag2", "");
+ tags[2] = XML::getProperty(node, "tag3", "");
+
int drawPriority = XML::getProperty(node, "drawPriority", 0);
int attackRange = XML::getProperty(node, "attack-range", 0);
@@ -237,6 +242,18 @@ void ItemDB::load()
itemInfo->addTag(mTags["Equipment"]);
break;
}
+ for (int f = 0; f < 3; f++)
+ {
+ if (tags[f] != "")
+ {
+ if (mTags.find(tags[f]) == mTags.end())
+ {
+ mTagNames.push_back(tags[f]);
+ mTags[tags[f]] = tagNum ++;
+ }
+ itemInfo->addTag(mTags[tags[f]]);
+ }
+ }
itemInfo->setView(view);
itemInfo->setWeight(weight);