summaryrefslogtreecommitdiff
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
parent8775c79b86c7ee16f32a6c973f2f3dd1d7de69f8 (diff)
downloadmanaverse-c04cc2c9270b5a54fae239d0ae60356113bdf70b.tar.gz
manaverse-c04cc2c9270b5a54fae239d0ae60356113bdf70b.tar.bz2
manaverse-c04cc2c9270b5a54fae239d0ae60356113bdf70b.tar.xz
manaverse-c04cc2c9270b5a54fae239d0ae60356113bdf70b.zip
Improve Being::setHairTempSprite
-rw-r--r--src/being/being.cpp21
-rw-r--r--src/being/being.h3
2 files changed, 9 insertions, 15 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;
}
diff --git a/src/being/being.h b/src/being/being.h
index b19ccec31..376c180d5 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -343,8 +343,7 @@ class Being notfinal : public ActorSprite,
const int id) restrict2;
void setHairTempSprite(const unsigned int slot,
- const int id,
- std::string color) restrict2;
+ const int id) restrict2;
void updateSprite(const unsigned int slot,
const int id,