From 9015268746ed9052a9dc83839b2834b5feeab166 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 1 Apr 2012 22:13:39 +0200 Subject: Fixed problems with using the last emote The tmwa/BeingHandler was adjusting the effect id rather than the emote id, causing it to not find the last emote (and the rest of the emotes only worked correctly because the effect ids were consecutive in the same order as the emote ids). Furthermore, the EmoteShortcutContainer refused to draw the icon for the last emote due to an off-by-one error in dealing with the 1-adjusted emote ids used by the EmoteShortcut class. Also cleaned up some old remains of a player ignore strategy that used to use the two balloon emotes (this had been their original purpose). Reviewed-by: Erik Schilling --- src/gui/widgets/emoteshortcutcontainer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index 1230e47a..3105a762 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -60,7 +60,7 @@ EmoteShortcutContainer::EmoteShortcutContainer(): mEmoteImg.push_back(EmoteDB::get(i)->sprite); } - mMaxItems = EmoteDB::getLast() < MAX_ITEMS ? EmoteDB::getLast() : MAX_ITEMS; + mMaxItems = std::min(EmoteDB::getLast(), MAX_ITEMS); mBoxHeight = mBackgroundImg->getHeight(); mBoxWidth = mBackgroundImg->getWidth(); @@ -97,11 +97,10 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics) g->drawText(key, emoteX + 2, emoteY + 2, gcn::Graphics::LEFT); int emoteId = emoteShortcut->getEmote(i); - if (emoteId > 0 && emoteId <= EmoteDB::getLast()) + if (emoteId > 0 && emoteId <= EmoteDB::getLast() + 1) { mEmoteImg[emoteId - 1]->draw(g, emoteX + 2, emoteY + 10); } - } if (mEmoteMoved) -- cgit v1.2.3-60-g2f50