summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-11-25 18:18:57 +0300
committerAndrei Karas <akaras@inbox.ru>2013-11-25 18:18:57 +0300
commite29c49d5f84544ef8178b7240b30485bfaf9ebce (patch)
treeabba3ad42514cd14adc988ff37012c4361f2727e /src/being
parent488428c6dba3d1e82b017bfb3b08ba85ced82be2 (diff)
downloadplus-e29c49d5f84544ef8178b7240b30485bfaf9ebce.tar.gz
plus-e29c49d5f84544ef8178b7240b30485bfaf9ebce.tar.bz2
plus-e29c49d5f84544ef8178b7240b30485bfaf9ebce.tar.xz
plus-e29c49d5f84544ef8178b7240b30485bfaf9ebce.zip
prevent update some sprites from move packets and some other.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp15
-rw-r--r--src/being/being.h6
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,