summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-07 17:37:23 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-07 17:37:23 +0000
commit271374e1b887d92f2a10b564e33a6781065c3d6f (patch)
treecf1c70a8bcd26bb33bc39c69e31e4006db3b874a /src/being.cpp
parent92950d2f309550e21b33d851ef9bbf7906ce5e50 (diff)
downloadmana-client-271374e1b887d92f2a10b564e33a6781065c3d6f.tar.gz
mana-client-271374e1b887d92f2a10b564e33a6781065c3d6f.tar.bz2
mana-client-271374e1b887d92f2a10b564e33a6781065c3d6f.tar.xz
mana-client-271374e1b887d92f2a10b564e33a6781065c3d6f.zip
Merged changes made for the 0.0.24.1 release (4046:4048 from 0.0.24 branch).
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/being.cpp b/src/being.cpp
index e76370fd..31e3eb77 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -418,10 +418,12 @@ Being::drawEmotion(Graphics *graphics, int offsetX, int offsetY)
if (!mEmotion)
return;
- int px = mPx + offsetX + 3;
- int py = mPy + offsetY - 60;
+ const int px = mPx + offsetX + 3;
+ const int py = mPy + offsetY - 60;
+ const int emotionIndex = mEmotion - 1;
- graphics->drawImage(emotionSet->get(mEmotion - 1), px, py);
+ if (emotionIndex >= 0 && emotionIndex < emotionSet->size())
+ graphics->drawImage(emotionSet->get(emotionIndex), px, py);
}
void