summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-21 17:57:52 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-21 17:57:52 +0300
commitc04cc2c9270b5a54fae239d0ae60356113bdf70b (patch)
tree0cedd84738ff7a80ebbc59d6b9c60913ba2c9eb7 /src/being/being.cpp
parent8775c79b86c7ee16f32a6c973f2f3dd1d7de69f8 (diff)
downloadmv-c04cc2c9270b5a54fae239d0ae60356113bdf70b.tar.gz
mv-c04cc2c9270b5a54fae239d0ae60356113bdf70b.tar.bz2
mv-c04cc2c9270b5a54fae239d0ae60356113bdf70b.tar.xz
mv-c04cc2c9270b5a54fae239d0ae60356113bdf70b.zip
Improve Being::setHairTempSprite
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 86dd86eaa..c5c68068d 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2988,8 +2988,7 @@ void Being::setTempSprite(const unsigned int slot,
}
void Being::setHairTempSprite(const unsigned int slot,
- const int id,
- std::string color) restrict2
+ const int id) restrict2
{
if (!charServerHandler || slot >= charServerHandler->maxSprite())
return;
@@ -3021,12 +3020,13 @@ void Being::setHairTempSprite(const unsigned int slot,
int startTime = 0;
AnimatedSprite *restrict equipmentSprite = nullptr;
- ItemColor colorId = ItemColor_one;
- if (!cards.isEmpty())
- colorId = ItemColorManager::getColorFromCards(cards);
-
if (!filename.empty())
{
+ ItemColor colorId = ItemColor_one;
+ if (!cards.isEmpty())
+ colorId = ItemColorManager::getColorFromCards(cards);
+
+ std::string color = info.getDyeColorsString(mHairColor);
if (color.empty())
color = info.getDyeColorsString(colorId);
@@ -3954,9 +3954,7 @@ void Being::recalcSpritesOrder() restrict2
else
{
setHairTempSprite(remSprite,
- repIt->second,
- ItemDB::get(repIt->second)
- .getDyeColorsString(mHairColor));
+ repIt->second);
}
updatedSprite[remSprite] = true;
}
@@ -3982,10 +3980,7 @@ void Being::recalcSpritesOrder() restrict2
else
{
setHairTempSprite(slot2,
- repIt->second,
- ItemDB::get(repIt->second)
- .getDyeColorsString(
- mHairColor));
+ repIt->second);
}
updatedSprite[slot2] = true;
}