summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-08 16:07:07 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-08 16:07:07 +0300
commit8ac687d770f3a8f13f9e0a50909b435933c86f6b (patch)
tree18d2b51363d7f731f7f8383b2bce5c6c354507fc
parent83b27b146211fe301f751a6aed27e22271190795 (diff)
downloadmv-8ac687d770f3a8f13f9e0a50909b435933c86f6b.tar.gz
mv-8ac687d770f3a8f13f9e0a50909b435933c86f6b.tar.bz2
mv-8ac687d770f3a8f13f9e0a50909b435933c86f6b.tar.xz
mv-8ac687d770f3a8f13f9e0a50909b435933c86f6b.zip
Add support for getting sprite color by cards in Being.
But for now mostly unused.
-rw-r--r--src/being/being.cpp9
-rw-r--r--src/being/being.h5
2 files changed, 10 insertions, 4 deletions
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,