summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-20 21:22:22 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-20 21:22:22 +0300
commitf88506ac95b8ea9f02d22c35f81e59d4283151b6 (patch)
treed44c62c270b035a7d937c4084871baa5d1bb1258 /src/being/being.cpp
parentf582b2ea6a8f311b47377bcf45f05066639e5a3d (diff)
downloadmanaplus-f88506ac95b8ea9f02d22c35f81e59d4283151b6.tar.gz
manaplus-f88506ac95b8ea9f02d22c35f81e59d4283151b6.tar.bz2
manaplus-f88506ac95b8ea9f02d22c35f81e59d4283151b6.tar.xz
manaplus-f88506ac95b8ea9f02d22c35f81e59d4283151b6.zip
In Being replace mSpritesColor to using mSlots field.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 69056cf44..9acf9fe57 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -168,7 +168,6 @@ Being::Being(const BeingId id,
mText(nullptr),
mTextColor(nullptr),
mDest(),
- mSpriteColors(),
mSlots(),
mSpriteParticles(),
mGuilds(),
@@ -2504,9 +2503,6 @@ void Being::setSprite(const unsigned int slot,
if (slot >= CAST_U32(mSlots.size()))
mSlots.resize(slot + 1, BeingSlot());
- if (slot >= CAST_U32(mSpriteColors.size()))
- mSpriteColors.resize(slot + 1, "");
-
// disabled for now, because it may broke replace/reorder sprites logic
// if (slot && mSlots[slot].spriteId == id)
// return;
@@ -2584,7 +2580,7 @@ void Being::setSprite(const unsigned int slot,
}
mSlots[slot].spriteId = id;
- mSpriteColors[slot] = color;
+ mSlots[slot].color = color;
mSlots[slot].colorId = colorId;
mSlots[slot].cardsId = CardsList(cards);
recalcSpritesOrder();
@@ -2614,9 +2610,6 @@ void Being::setTempSprite(const unsigned int slot,
if (slot >= CAST_U32(mSlots.size()))
mSlots.resize(slot + 1, BeingSlot());
- if (slot >= CAST_U32(mSpriteColors.size()))
- mSpriteColors.resize(slot + 1, "");
-
// id = 0 means unequip
if (id == 0)
{
@@ -2679,7 +2672,7 @@ void Being::setSpriteID(const unsigned int slot,
{
setSprite(slot,
id,
- mSpriteColors[slot],
+ mSlots[slot].color,
ItemColor_one,
mSlots[slot].cardsId);
}
@@ -2725,16 +2718,14 @@ void Being::dumpSprites() const restrict2
{
std::vector<BeingSlot>::const_iterator it1 = mSlots.begin();
const std::vector<BeingSlot>::const_iterator it1_end = mSlots.end();
- StringVectCIter it2 = mSpriteColors.begin();
- const StringVectCIter it2_end = mSpriteColors.end();
logger->log("sprites");
- for (; it1 != it1_end && it2 != it2_end;
- ++ it1, ++ it2)
+ for (; it1 != it1_end;
+ ++ it1)
{
logger->log("%d,%s,%d",
(*it1).spriteId,
- (*it2).c_str(),
+ (*it1).color.c_str(),
toInt((*it1).colorId, int));
}
}
@@ -2904,7 +2895,7 @@ void Being::setGender(const GenderT gender) restrict2
{
setSprite(i,
mSlots[i].spriteId,
- mSpriteColors[i],
+ mSlots[i].color,
ItemColor_one,
mSlots[i].cardsId);
}
@@ -3477,7 +3468,7 @@ void Being::recalcSpritesOrder() restrict2
{
setTempSprite(remSprite,
repIt->second,
- mSpriteColors[remSprite],
+ mSlots[remSprite].color,
mSlots[remSprite].cardsId);
}
else
@@ -3508,7 +3499,7 @@ void Being::recalcSpritesOrder() restrict2
{
setTempSprite(slot2,
repIt->second,
- mSpriteColors[slot2],
+ mSlots[slot2].color,
mSlots[slot2].cardsId);
}
else
@@ -3662,7 +3653,7 @@ void Being::recalcSpritesOrder() restrict2
updatedSprite[slot] = true;
setTempSprite(slot,
id,
- mSpriteColors[slot],
+ mSlots[slot].color,
mSlots[slot].cardsId);
}
}
@@ -3677,7 +3668,7 @@ void Being::recalcSpritesOrder() restrict2
{
setTempSprite(static_cast<unsigned int>(slot),
id,
- mSpriteColors[slot],
+ mSlots[slot].color,
mSlots[slot].cardsId);
}
}