From e29c49d5f84544ef8178b7240b30485bfaf9ebce Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Nov 2013 18:18:57 +0300 Subject: prevent update some sprites from move packets and some other. --- src/being/being.cpp | 15 +++++++++++++++ src/being/being.h | 6 ++++++ 2 files changed, 21 insertions(+) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index f3976a20e..c503e94d5 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1902,6 +1902,21 @@ void Being::updateColors() } } +void Being::updateSprite(const unsigned int slot, const int id, + std::string color, const unsigned char colorId, + const bool isWeapon, const bool isTempSprite) +{ + if (slot >= Net::getCharServerHandler()->maxSprite()) + return; + + if (slot >= mSpriteIDs.size()) + mSpriteIDs.resize(slot + 1, 0); + + if (slot && mSpriteIDs[slot] == id) + return; + setSprite(slot, id, color, colorId, isWeapon, isTempSprite); +} + void Being::setSprite(const unsigned int slot, const int id, std::string color, const unsigned char colorId, const bool isWeapon, const bool isTempSprite) diff --git a/src/being/being.h b/src/being/being.h index a2316d607..41957ceca 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -378,6 +378,12 @@ class Being : public ActorSprite, public ConfigListener const bool isWeapon = false, const bool isTempSprite = false); + void updateSprite(const unsigned int slot, const int id, + std::string color = "", + const unsigned char colorId = 1, + const bool isWeapon = false, + const bool isTempSprite = false); + void setSpriteID(const unsigned int slot, const int id); void setSpriteColor(const unsigned int slot, -- cgit v1.2.3-70-g09d2