From d78fb807d9b3a985d7c9b79ae29e6642dc831a5f Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Fri, 16 Jan 2009 09:22:35 -0700 Subject: Fixed a potential crash when the emotes aren't loaded, or there are less than 12 emotes. Signed-off-by: Ira Rice --- src/gui/emoteshortcutcontainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/emoteshortcutcontainer.cpp') diff --git a/src/gui/emoteshortcutcontainer.cpp b/src/gui/emoteshortcutcontainer.cpp index a7347bb0..f7917f85 100644 --- a/src/gui/emoteshortcutcontainer.cpp +++ b/src/gui/emoteshortcutcontainer.cpp @@ -60,7 +60,7 @@ EmoteShortcutContainer::EmoteShortcutContainer(): mEmoteImg.push_back(player_node->getEmote(i)); } - mMaxItems = MAX_ITEMS; + mMaxItems = EmoteDB::getLast() < MAX_ITEMS ? EmoteDB::getLast() : MAX_ITEMS; mBoxHeight = mBackgroundImg->getHeight(); mBoxWidth = mBackgroundImg->getWidth(); -- cgit v1.2.3-70-g09d2