summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-20 21:01:48 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-20 21:01:48 +0300
commit5788066c2033ed8985940f1fef7626ba4e795a7c (patch)
tree62a59067d5bb6ca4197adc9fd95f75ae3f759595
parentead240c9e3324256f08b14517a9c110ddd112fb9 (diff)
downloadmanaplus-5788066c2033ed8985940f1fef7626ba4e795a7c.tar.gz
manaplus-5788066c2033ed8985940f1fef7626ba4e795a7c.tar.bz2
manaplus-5788066c2033ed8985940f1fef7626ba4e795a7c.tar.xz
manaplus-5788066c2033ed8985940f1fef7626ba4e795a7c.zip
In Being replace mSpriteCardsIds to using mSlots field.
-rw-r--r--src/being/being.cpp36
-rw-r--r--src/being/being.h1
-rw-r--r--src/beingequipbackend.cpp2
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<unsigned int>(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<BeingSlot> mSlots;
- std::vector<CardsList> mSpriteCardsIds;
std::vector<ItemColor> 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;