summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp11
-rw-r--r--src/being.h2
-rw-r--r--src/gui/emotecontainer.cpp10
-rw-r--r--src/gui/emoteshortcutcontainer.cpp9
4 files changed, 9 insertions, 23 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 883344d8..98aaeec2 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -93,12 +93,9 @@ Being::Being(int id, int job, Map *map):
{
EmoteInfo info = EmoteDB::get(i);
- if (info.sprites != EmoteDB::getUnknown().sprites)
- {
- std::string file = "graphics/sprites/" + info.sprites.front()->sprite;
- int variant = info.sprites.front()->variant;
- emotionSet.push_back(AnimatedSprite::load(file, variant));
- }
+ std::string file = "graphics/sprites/" + info.sprites.front()->sprite;
+ int variant = info.sprites.front()->variant;
+ emotionSet.push_back(AnimatedSprite::load(file, variant));
}
// Hairstyles are encoded as negative numbers. Count how far negative we can go.
@@ -456,7 +453,7 @@ void Being::drawEmotion(Graphics *graphics, int offsetX, int offsetY)
const int py = mPy + offsetY - 60;
const int emotionIndex = mEmotion - 1;
- if (emotionIndex >= 0 && emotionIndex < EmoteDB::getLast())
+ if (emotionIndex >= 0 && emotionIndex <= EmoteDB::getLast())
emotionSet[emotionIndex]->draw(graphics, px, py);
}
diff --git a/src/being.h b/src/being.h
index 4534b1ea..6dbcdfdd 100644
--- a/src/being.h
+++ b/src/being.h
@@ -351,6 +351,8 @@ class Being : public Sprite
*/
void controlParticle(Particle *particle);
+ AnimatedSprite* getEmote(int index) { return emotionSet[index]; }
+
void setEmote(Uint8 emotion, Uint8 emote_time)
{
mEmotion = emotion;
diff --git a/src/gui/emotecontainer.cpp b/src/gui/emotecontainer.cpp
index 691211ca..cba744dd 100644
--- a/src/gui/emotecontainer.cpp
+++ b/src/gui/emotecontainer.cpp
@@ -28,6 +28,7 @@
#include "../animatedsprite.h"
#include "../configuration.h"
#include "../graphics.h"
+#include "../localplayer.h"
#include "../log.h"
#include "../resources/emotedb.h"
@@ -52,14 +53,7 @@ EmoteContainer::EmoteContainer():
// Setup emote sprites
for (int i = 0; i <= EmoteDB::getLast(); i++)
{
- EmoteInfo info = EmoteDB::get(i);
-
- if (info.sprites != EmoteDB::getUnknown().sprites)
- {
- std::string file = "graphics/sprites/" + info.sprites.front()->sprite;
- int variant = info.sprites.front()->variant;
- mEmoteImg.push_back(AnimatedSprite::load(file, variant));
- }
+ mEmoteImg.push_back(player_node->getEmote(i));
}
mSelImg = resman->getImage("graphics/gui/selection.png");
diff --git a/src/gui/emoteshortcutcontainer.cpp b/src/gui/emoteshortcutcontainer.cpp
index edaa8602..a7347bb0 100644
--- a/src/gui/emoteshortcutcontainer.cpp
+++ b/src/gui/emoteshortcutcontainer.cpp
@@ -57,14 +57,7 @@ EmoteShortcutContainer::EmoteShortcutContainer():
// Setup emote sprites
for (int i = 0; i <= EmoteDB::getLast(); i++)
{
- EmoteInfo info = EmoteDB::get(i);
-
- if (info.sprites != EmoteDB::getUnknown().sprites)
- {
- std::string file = "graphics/sprites/" + info.sprites.front()->sprite;
- int variant = info.sprites.front()->variant;
- mEmoteImg.push_back(AnimatedSprite::load(file, variant));
- }
+ mEmoteImg.push_back(player_node->getEmote(i));
}
mMaxItems = MAX_ITEMS;