diff options
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 15 | ||||
-rw-r--r-- | src/being/being.h | 6 |
2 files changed, 21 insertions, 0 deletions
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, |