summaryrefslogtreecommitdiff
path: root/src/gui/widgets/emoteshortcutcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-05-07 03:58:26 +0300
committerJared Adams <jaxad0127@gmail.com>2010-05-06 22:14:07 -0600
commit46cd4e737a5a74f823877c1fd00a6af84005612f (patch)
tree4fa78e422d59a02161a47c7806b67b02a6cc0b3e /src/gui/widgets/emoteshortcutcontainer.cpp
parent43de94e81348f8b1e0318924c35bb7f3c58eb092 (diff)
downloadmana-46cd4e737a5a74f823877c1fd00a6af84005612f.tar.gz
mana-46cd4e737a5a74f823877c1fd00a6af84005612f.tar.bz2
mana-46cd4e737a5a74f823877c1fd00a6af84005612f.tar.xz
mana-46cd4e737a5a74f823877c1fd00a6af84005612f.zip
Fix reading arrays at index -1.
Signed-off-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/gui/widgets/emoteshortcutcontainer.cpp')
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 2b07ad1e..82fb9f8d 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -124,11 +124,12 @@ void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event)
if (!mEmoteMoved && mEmoteClicked)
{
const int index = getIndexFromGrid(event.getX(), event.getY());
- const int emoteId = emoteShortcut->getEmote(index);
if (index == -1)
return;
+ const int emoteId = emoteShortcut->getEmote(index);
+
if (emoteId)
{
mEmoteMoved = emoteId;