summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-21 01:44:57 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-21 01:44:57 +0300
commitcfe4c893ba4ba30379919636d3c508ebf1594e23 (patch)
tree94abccb0bfbf6ce3675186f80c7243bbf4b6c157 /src/being.cpp
parent52f78717dae3cb02eb1539841dd2a6bd351f74c1 (diff)
downloadmanaplus-cfe4c893ba4ba30379919636d3c508ebf1594e23.tar.gz
manaplus-cfe4c893ba4ba30379919636d3c508ebf1594e23.tar.bz2
manaplus-cfe4c893ba4ba30379919636d3c508ebf1594e23.tar.xz
manaplus-cfe4c893ba4ba30379919636d3c508ebf1594e23.zip
add owned show time to each emote type.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 9411cbe8b..d5012ac06 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -2785,12 +2785,21 @@ void Being::setEmote(const uint8_t emotion, const int emote_time)
if (emotionIndex >= 0 && emotionIndex <= EmoteDB::getLast())
{
delete mEmotionSprite;
- mEmotionSprite = EmoteDB::getClone(emotionIndex, true);
+ const EmoteInfo *const info = EmoteDB::get2(emotionIndex, true);
+ if (info)
+ {
+ const EmoteSprite *const sprite = info->sprites.front();
+ if (sprite)
+ {
+ mEmotionSprite = AnimatedSprite::clone(sprite->sprite);
+ if (mEmotionSprite)
+ mEmotionTime = info->time;
+ }
+ }
}
if (mEmotionSprite)
{
- mEmotionTime = emote_time;
mEmotionSprite->play(mSpriteAction);
mEmotionSprite->setSpriteDirection(static_cast<SpriteDirection>(
mSpriteDirection));