From 5788066c2033ed8985940f1fef7626ba4e795a7c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 20 Jun 2016 21:01:48 +0300 Subject: In Being replace mSpriteCardsIds to using mSlots field. --- src/being/being.cpp | 36 +++++++++++++----------------------- src/being/being.h | 1 - src/beingequipbackend.cpp | 2 +- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/being/being.cpp b/src/being/being.cpp index 62217b71e..7881edb5d 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -170,7 +170,6 @@ Being::Being(const BeingId id, mDest(), mSpriteColors(), mSlots(), - mSpriteCardsIds(), mSpriteColorsIds(), mSpriteParticles(), mGuilds(), @@ -2486,12 +2485,9 @@ void Being::updateSprite(const unsigned int slot, if (slot >= CAST_U32(mSlots.size())) mSlots.resize(slot + 1, BeingSlot()); - if (slot >= CAST_U32(mSpriteCardsIds.size())) - mSpriteCardsIds.resize(slot + 1, zeroCards); - if (slot && mSlots[slot].spriteId == id) return; - setSprite(slot, id, color, colorId, mSpriteCardsIds[slot]); + setSprite(slot, id, color, colorId, mSlots[slot].cardsId); } void Being::setSprite(const unsigned int slot, @@ -2509,9 +2505,6 @@ void Being::setSprite(const unsigned int slot, if (slot >= CAST_U32(mSlots.size())) mSlots.resize(slot + 1, BeingSlot()); - if (slot >= CAST_U32(mSpriteCardsIds.size())) - mSpriteCardsIds.resize(slot + 1, zeroCards); - if (slot >= CAST_U32(mSpriteColors.size())) mSpriteColors.resize(slot + 1, ""); @@ -2597,7 +2590,7 @@ void Being::setSprite(const unsigned int slot, mSlots[slot].spriteId = id; mSpriteColors[slot] = color; mSpriteColorsIds[slot] = colorId; - mSpriteCardsIds[slot] = CardsList(cards); + mSlots[slot].cardsId = CardsList(cards); recalcSpritesOrder(); if (beingEquipmentWindow) beingEquipmentWindow->updateBeing(this); @@ -2625,9 +2618,6 @@ void Being::setTempSprite(const unsigned int slot, if (slot >= CAST_U32(mSlots.size())) mSlots.resize(slot + 1, BeingSlot()); - if (slot >= CAST_U32(mSpriteCardsIds.size())) - mSpriteCardsIds.resize(slot + 1, zeroCards); - if (slot >= CAST_U32(mSpriteColors.size())) mSpriteColors.resize(slot + 1, ""); @@ -2698,7 +2688,7 @@ void Being::setSpriteID(const unsigned int slot, id, mSpriteColors[slot], ItemColor_one, - mSpriteCardsIds[slot]); + mSlots[slot].cardsId); } void Being::setSpriteColor(const unsigned int slot, @@ -2708,7 +2698,7 @@ void Being::setSpriteColor(const unsigned int slot, mSlots[slot].spriteId, color, ItemColor_one, - mSpriteCardsIds[slot]); + mSlots[slot].cardsId); } void Being::setHairStyle(const unsigned int slot, @@ -2719,7 +2709,7 @@ void Being::setHairStyle(const unsigned int slot, id, ItemDB::get(id).getDyeColorsString(mHairColor), ItemColor_one, - mSpriteCardsIds[slot]); + mSlots[slot].cardsId); // dumpSprites(); } @@ -2734,7 +2724,7 @@ void Being::setHairColor(const unsigned int slot, mSlots[slot].spriteId, ItemDB::get(id).getDyeColorsString(color), ItemColor_one, - mSpriteCardsIds[slot]); + mSlots[slot].cardsId); } } @@ -2923,7 +2913,7 @@ void Being::setGender(const GenderT gender) restrict2 mSlots[i].spriteId, mSpriteColors[i], ItemColor_one, - mSpriteCardsIds[i]); + mSlots[i].cardsId); } } @@ -3495,7 +3485,7 @@ void Being::recalcSpritesOrder() restrict2 setTempSprite(remSprite, repIt->second, mSpriteColors[remSprite], - mSpriteCardsIds[remSprite]); + mSlots[remSprite].cardsId); } else { @@ -3503,7 +3493,7 @@ void Being::recalcSpritesOrder() restrict2 repIt->second, ItemDB::get(repIt->second) .getDyeColorsString(mHairColor), - mSpriteCardsIds[remSprite]); + mSlots[remSprite].cardsId); } updatedSprite[remSprite] = true; } @@ -3526,7 +3516,7 @@ void Being::recalcSpritesOrder() restrict2 setTempSprite(slot2, repIt->second, mSpriteColors[slot2], - mSpriteCardsIds[slot2]); + mSlots[slot2].cardsId); } else { @@ -3535,7 +3525,7 @@ void Being::recalcSpritesOrder() restrict2 ItemDB::get(repIt->second) .getDyeColorsString( mHairColor), - mSpriteCardsIds[slot2]); + mSlots[slot2].cardsId); } updatedSprite[slot2] = true; } @@ -3680,7 +3670,7 @@ void Being::recalcSpritesOrder() restrict2 setTempSprite(slot, id, mSpriteColors[slot], - mSpriteCardsIds[slot]); + mSlots[slot].cardsId); } } } @@ -3695,7 +3685,7 @@ void Being::recalcSpritesOrder() restrict2 setTempSprite(static_cast(slot), id, mSpriteColors[slot], - mSpriteCardsIds[slot]); + mSlots[slot].cardsId); } } } diff --git a/src/being/being.h b/src/being/being.h index 16e3ed74b..d51a9fda4 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -1097,7 +1097,6 @@ class Being notfinal : public ActorSprite, StringVect mSpriteColors; std::vector mSlots; - std::vector mSpriteCardsIds; std::vector mSpriteColorsIds; SpriteParticleInfo mSpriteParticles; diff --git a/src/beingequipbackend.cpp b/src/beingequipbackend.cpp index eb05a11fd..f19fbd4a9 100644 --- a/src/beingequipbackend.cpp +++ b/src/beingequipbackend.cpp @@ -54,7 +54,7 @@ BeingEquipBackend::BeingEquipBackend(Being *const being) Favorite_false, Equipm_true, Equipped_true); - const CardsList &cards = being->mSpriteCardsIds[f]; + const CardsList &cards = being->mSlots[f].cardsId; if (!cards.isEmpty()) item->setCards(&cards.cards[0], maxCards); mEquipment[idx] = item; -- cgit v1.2.3-70-g09d2