From 8ac687d770f3a8f13f9e0a50909b435933c86f6b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 8 Jun 2016 16:07:07 +0300 Subject: Add support for getting sprite color by cards in Being. But for now mostly unused. --- src/being/being.cpp | 9 +++++++-- src/being/being.h | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/being/being.cpp b/src/being/being.cpp index 3e57c969c..855a081e9 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -27,6 +27,7 @@ #include "configuration.h" #include "effectmanager.h" #include "guild.h" +#include "itemcolormanager.h" #include "party.h" #include "settings.h" #include "soundmanager.h" @@ -2486,9 +2487,10 @@ void Being::updateSprite(const unsigned int slot, void Being::setSprite(const unsigned int slot, const int id, std::string color, - const ItemColor colorId, + ItemColor colorId, const IsWeapon isWeapon, - const IsTempSprite isTempSprite) restrict2 + const IsTempSprite isTempSprite, + const int *const cards) restrict2 { if (!charServerHandler || slot >= charServerHandler->maxSprite()) return; @@ -2549,6 +2551,9 @@ void Being::setSprite(const unsigned int slot, addPet(pet); } + if (cards != nullptr) + colorId = ItemColorManager::getColorFromCards(cards); + if (!filename.empty()) { if (color.empty()) diff --git a/src/being/being.h b/src/being/being.h index b71f38c0a..5c9f7115d 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -322,9 +322,10 @@ class Being notfinal : public ActorSprite, void setSprite(const unsigned int slot, const int id, std::string color = "", - const ItemColor colorId = ItemColor_one, + ItemColor colorId = ItemColor_one, const IsWeapon isWeapon = IsWeapon_false, - const IsTempSprite isTempSprite = IsTempSprite_false) + const IsTempSprite isTempSprite = IsTempSprite_false, + const int *const cards = nullptr) restrict2; void updateSprite(const unsigned int slot, -- cgit v1.2.3-60-g2f50