diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-06-21 16:54:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-06-21 16:54:46 +0300 |
commit | 7fc54b6d5b3e858296747b0cdb0d1c4ddf4e35d8 (patch) | |
tree | 3d6e06849e10ae46fa3840c3af65102a6570adbe /src | |
parent | 7dbab059a3703b1afffc87eb8653a532f8796832 (diff) | |
download | ManaVerse-7fc54b6d5b3e858296747b0cdb0d1c4ddf4e35d8.tar.gz ManaVerse-7fc54b6d5b3e858296747b0cdb0d1c4ddf4e35d8.tar.bz2 ManaVerse-7fc54b6d5b3e858296747b0cdb0d1c4ddf4e35d8.tar.xz ManaVerse-7fc54b6d5b3e858296747b0cdb0d1c4ddf4e35d8.zip |
Simplify Being::setSpriteCards, remove color parameters.
Diffstat (limited to 'src')
-rw-r--r-- | src/being/being.cpp | 19 | ||||
-rw-r--r-- | src/being/being.h | 2 | ||||
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 33 |
3 files changed, 8 insertions, 46 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 08f1acddd..1023eb1d6 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2802,11 +2802,9 @@ void Being::setSpriteColorId(const unsigned int slot, beingEquipmentWindow->updateBeing(this); } -// set sprite id, colors, cards +// set sprite id, colors from cards, cards void Being::setSpriteCards(const unsigned int slot, const int id, - std::string color, - ItemColor colorId, CardsList cards) restrict2 { if (!charServerHandler || slot >= charServerHandler->maxSprite()) @@ -2822,6 +2820,9 @@ void Being::setSpriteCards(const unsigned int slot, // if (slot && mSlots[slot].spriteId == id) // return; + ItemColor colorId = ItemColor_one; + std::string color; + // id = 0 means unequip if (id == 0) { @@ -3061,11 +3062,9 @@ void Being::setHairStyle(const unsigned int slot, const int id) restrict2 { // dumpSprites(); - setSpriteCards(slot, + setSpriteColor(slot, id, - ItemDB::get(id).getDyeColorsString(mHairColor), - ItemColor_one, - mSlots[slot].cardsId); + ItemDB::get(id).getDyeColorsString(mHairColor)); // dumpSprites(); } @@ -3077,11 +3076,9 @@ void Being::setHairColor(const unsigned int slot, const int id = beingSlot.spriteId; if (id != 0) { - setSpriteCards(slot, + setSpriteColor(slot, id, - ItemDB::get(id).getDyeColorsString(color), - ItemColor_one, - beingSlot.cardsId); + ItemDB::get(id).getDyeColorsString(color)); } } diff --git a/src/being/being.h b/src/being/being.h index 62ad47ea9..af3f702c9 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -330,8 +330,6 @@ class Being notfinal : public ActorSprite, void setSpriteCards(const unsigned int slot, const int id, - std::string color, - ItemColor colorId, CardsList cards) restrict2; void setSpriteId(const unsigned int slot, diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index c8b7c52a4..3902169cf 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -142,7 +142,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, if (dstBeing->getType() == ActorType::Player) dstBeing->setOtherTime(); - const ItemColor itemColor = ItemColorManager::getColorFromCards(cards); switch (type) { // here should be used SPRITE_* constants @@ -160,8 +159,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 2: // LOOK_WEAPON Weapon ID in id, Shield ID in id2 dstBeing->setSpriteCards(SPRITE_BODY, id, - std::string(), - itemColor, CardsList(cards)); dstBeing->setWeaponId(id); dstBeing->setSpriteId(SPRITE_FLOOR, @@ -172,8 +169,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 3: // LOOK_HEAD_BOTTOM dstBeing->setSpriteCards(SPRITE_WEAPON, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_WEAPON); @@ -181,8 +176,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 4: // LOOK_HEAD_TOP Change upper headgear for eAthena, hat for us dstBeing->setSpriteCards(SPRITE_CLOTHES_COLOR, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_CLOTHES_COLOR); @@ -191,8 +184,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, // armor for us dstBeing->setSpriteCards(SPRITE_HEAD_BOTTOM, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_BOTTOM); @@ -210,8 +201,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 8: // eAthena LOOK_SHIELD dstBeing->setSpriteCards(SPRITE_FLOOR, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_FLOOR); @@ -219,8 +208,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 9: // eAthena LOOK_SHOES dstBeing->setSpriteCards(SPRITE_HAIR, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_HAIR); @@ -228,8 +215,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 10: // LOOK_GLOVES dstBeing->setSpriteCards(SPRITE_SHOES, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_SHOES); @@ -237,8 +222,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 11: // LOOK_FLOOR dstBeing->setSpriteCards(SPRITE_SHIELD, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_SHIELD); @@ -246,8 +229,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 12: // LOOK_ROBE dstBeing->setSpriteCards(SPRITE_HEAD_TOP, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_TOP); @@ -255,8 +236,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 13: // COSTUME_HEAD_TOP dstBeing->setSpriteCards(SPRITE_HEAD_MID, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_MID); @@ -264,8 +243,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 14: // COSTUME_HEAD_MID dstBeing->setSpriteCards(SPRITE_ROBE, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_ROBE); @@ -273,8 +250,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 15: // COSTUME_HEAD_LOW dstBeing->setSpriteCards(SPRITE_EVOL2, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL2); @@ -282,8 +257,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 16: // COSTUME_GARMENT dstBeing->setSpriteCards(SPRITE_EVOL3, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL3); @@ -291,8 +264,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 17: // ARMOR dstBeing->setSpriteCards(SPRITE_EVOL4, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL4); @@ -300,8 +271,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 18: dstBeing->setSpriteCards(SPRITE_EVOL5, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL5); @@ -309,8 +278,6 @@ void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, case 19: dstBeing->setSpriteCards(SPRITE_EVOL6, id, - std::string(), - itemColor, CardsList(cards)); if (localPlayer) localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL6); |