diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-03 02:50:03 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-03 02:50:03 +0200 |
commit | de51eaa43e05c2126fc1eef2a7e115843f972547 (patch) | |
tree | 286a05a069e048247f90c7595f1b8939be784608 /src/being.cpp | |
parent | d4c08d3bf69410a35a50875de50cc6fe74b3bf3e (diff) | |
parent | 8627c7745f47492ab349da6a74e98e3d5813418f (diff) | |
download | manaplus-de51eaa43e05c2126fc1eef2a7e115843f972547.tar.gz manaplus-de51eaa43e05c2126fc1eef2a7e115843f972547.tar.bz2 manaplus-de51eaa43e05c2126fc1eef2a7e115843f972547.tar.xz manaplus-de51eaa43e05c2126fc1eef2a7e115843f972547.zip |
Merge branch 'coloritems'
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/being.cpp b/src/being.cpp index 7265aa337..2f2e69d16 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -1483,8 +1483,8 @@ void Being::updateColors() } } -void Being::setSprite(unsigned int slot, int id, const std::string &color, - bool isWeapon, bool isTempSprite) +void Being::setSprite(unsigned int slot, int id, std::string color, + unsigned char colorId, bool isWeapon, bool isTempSprite) { if (slot >= Net::getCharHandler()->maxSprite()) return; @@ -1508,13 +1508,15 @@ void Being::setSprite(unsigned int slot, int id, const std::string &color, } else { - std::string filename = ItemDB::get(id).getSprite(mGender); + ItemInfo info = ItemDB::get(id); + std::string filename = info.getSprite(mGender); AnimatedSprite *equipmentSprite = NULL; if (!filename.empty()) { - if (!color.empty()) - filename += "|" + color; + if (color.empty()) + color = info.getDyeColorsString(colorId); + filename = combineDye(filename, color); equipmentSprite = AnimatedSprite::load( paths.getStringValue("sprites") + filename); @@ -1931,7 +1933,7 @@ void Being::recalcSpritesOrder() if (repIt->second != 1) { setSprite(removeSprite, repIt->second, - mSpriteColors[removeSprite], false, true); + mSpriteColors[removeSprite], 1, false, true); } } } @@ -2066,7 +2068,7 @@ void Being::recalcSpritesOrder() if (!id) continue; - setSprite(slot, id, mSpriteColors[slot], false, true); + setSprite(slot, id, mSpriteColors[slot], 1, false, true); } // logger->log("slot %d = %d", slot, mSpriteRemap[slot]); } |