summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-14 03:56:02 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-14 04:06:13 +0300
commit112d2ad1904051160822d1845d1418cca889c0d5 (patch)
tree9731934d9dc367f931c028158f3d26a670e18feb /src/resources
parent02e9a62ce9a0f288804bfa2aa59c3a84b0376c4a (diff)
downloadmanaplus-112d2ad1904051160822d1845d1418cca889c0d5.tar.gz
manaplus-112d2ad1904051160822d1845d1418cca889c0d5.tar.bz2
manaplus-112d2ad1904051160822d1845d1418cca889c0d5.tar.xz
manaplus-112d2ad1904051160822d1845d1418cca889c0d5.zip
Add support for other gender.
Fix per gender and race items separation.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/itemdb.cpp3
-rw-r--r--src/resources/iteminfo.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 3aadc662e..eb6d4a6b8 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -169,6 +169,7 @@ void ItemDB::load()
std::string errFile = paths.getStringValue("spriteErrorFile");
mUnknown->setSprite(errFile, GENDER_MALE, 0);
mUnknown->setSprite(errFile, GENDER_FEMALE, 0);
+ mUnknown->setSprite(errFile, GENDER_OTHER, 0);
mUnknown->addTag(mTags["All"]);
XML::Document doc("items.xml");
@@ -604,6 +605,8 @@ void loadSpriteRef(ItemInfo *itemInfo, XmlNodePtr node)
itemInfo->setSprite(filename, GENDER_MALE, race);
if (gender == "female" || gender == "unisex")
itemInfo->setSprite(filename, GENDER_FEMALE, race);
+ if (gender == "other" || gender == "unisex")
+ itemInfo->setSprite(filename, GENDER_OTHER, race);
}
void loadSoundRef(ItemInfo *itemInfo, XmlNodePtr node)
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 15454dccd..2bf71bcec 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -112,13 +112,13 @@ const std::string &ItemInfo::getSprite(Gender gender, int race) const
{
static const std::string empty("");
std::map<int, std::string>::const_iterator i =
- mAnimationFiles.find(static_cast<int>(gender) * 2 + race);
+ mAnimationFiles.find(static_cast<int>(gender) + race * 4);
if (i != mAnimationFiles.end())
return i->second;
if (serverVersion > 0)
{
- i = mAnimationFiles.find(static_cast<int>(gender) * 2);
+ i = mAnimationFiles.find(static_cast<int>(gender));
if (i != mAnimationFiles.end())
return i->second;
}
@@ -325,5 +325,5 @@ int ItemInfo::getDrawPriority(int direction) const
void ItemInfo::setSprite(const std::string &animationFile,
Gender gender, int race)
{
- mAnimationFiles[static_cast<int>(gender) * 2 + race] = animationFile;
+ mAnimationFiles[static_cast<int>(gender) + race * 4] = animationFile;
}