summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-20 21:09:08 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-20 21:09:08 +0300
commitf582b2ea6a8f311b47377bcf45f05066639e5a3d (patch)
tree6d2907e3ac1b30d1c4e01035058cd35dbf064462 /src/being
parent5788066c2033ed8985940f1fef7626ba4e795a7c (diff)
downloadmv-f582b2ea6a8f311b47377bcf45f05066639e5a3d.tar.gz
mv-f582b2ea6a8f311b47377bcf45f05066639e5a3d.tar.bz2
mv-f582b2ea6a8f311b47377bcf45f05066639e5a3d.tar.xz
mv-f582b2ea6a8f311b47377bcf45f05066639e5a3d.zip
In Being replace mSpriteColorIds to using mSlots field.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp25
-rw-r--r--src/being/being.h1
2 files changed, 9 insertions, 17 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 7881edb5d..69056cf44 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -170,7 +170,6 @@ Being::Being(const BeingId id,
mDest(),
mSpriteColors(),
mSlots(),
- mSpriteColorsIds(),
mSpriteParticles(),
mGuilds(),
mParty(nullptr),
@@ -2508,9 +2507,6 @@ void Being::setSprite(const unsigned int slot,
if (slot >= CAST_U32(mSpriteColors.size()))
mSpriteColors.resize(slot + 1, "");
- if (slot >= CAST_U32(mSpriteColorsIds.size()))
- mSpriteColorsIds.resize(slot + 1, ItemColor_one);
-
// disabled for now, because it may broke replace/reorder sprites logic
// if (slot && mSlots[slot].spriteId == id)
// return;
@@ -2589,7 +2585,7 @@ void Being::setSprite(const unsigned int slot,
mSlots[slot].spriteId = id;
mSpriteColors[slot] = color;
- mSpriteColorsIds[slot] = colorId;
+ mSlots[slot].colorId = colorId;
mSlots[slot].cardsId = CardsList(cards);
recalcSpritesOrder();
if (beingEquipmentWindow)
@@ -2621,9 +2617,6 @@ void Being::setTempSprite(const unsigned int slot,
if (slot >= CAST_U32(mSpriteColors.size()))
mSpriteColors.resize(slot + 1, "");
- if (slot >= CAST_U32(mSpriteColorsIds.size()))
- mSpriteColorsIds.resize(slot + 1, ItemColor_one);
-
// id = 0 means unequip
if (id == 0)
{
@@ -2734,15 +2727,15 @@ void Being::dumpSprites() const restrict2
const std::vector<BeingSlot>::const_iterator it1_end = mSlots.end();
StringVectCIter it2 = mSpriteColors.begin();
const StringVectCIter it2_end = mSpriteColors.end();
- std::vector<ItemColor>::const_iterator it3 = mSpriteColorsIds.begin();
- const std::vector<ItemColor>::const_iterator
- it3_end = mSpriteColorsIds.end();
logger->log("sprites");
- for (; it1 != it1_end && it2 != it2_end && it3 != it3_end;
- ++ it1, ++ it2, ++ it3)
+ for (; it1 != it1_end && it2 != it2_end;
+ ++ it1, ++ it2)
{
- logger->log("%d,%s,%d", (*it1).spriteId, (*it2).c_str(), toInt(*it3, int));
+ logger->log("%d,%s,%d",
+ (*it1).spriteId,
+ (*it2).c_str(),
+ toInt((*it1).colorId, int));
}
}
@@ -3983,10 +3976,10 @@ int Being::getSpriteID(const int slot) const restrict2
ItemColor Being::getSpriteColor(const int slot) const restrict2
{
- if (slot < 0 || CAST_SIZE(slot) >= mSpriteColorsIds.size())
+ if (slot < 0 || CAST_SIZE(slot) >= mSlots.size())
return ItemColor_one;
- return mSpriteColorsIds[slot];
+ return mSlots[slot].colorId;
}
void Being::addAfkEffect() restrict2
diff --git a/src/being/being.h b/src/being/being.h
index d51a9fda4..0574a3158 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -1097,7 +1097,6 @@ class Being notfinal : public ActorSprite,
StringVect mSpriteColors;
std::vector<BeingSlot> mSlots;
- std::vector<ItemColor> mSpriteColorsIds;
SpriteParticleInfo mSpriteParticles;
// Character guild information