From c04cc2c9270b5a54fae239d0ae60356113bdf70b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Jun 2016 17:57:52 +0300 Subject: Improve Being::setHairTempSprite --- src/being/being.cpp | 21 ++++++++------------- src/being/being.h | 3 +-- 2 files changed, 9 insertions(+), 15 deletions(-) (limited to 'src') 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, -- cgit v1.2.3-70-g09d2