From a39f63cdfa5ce15b22f294a8bb1db3a036ce462d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 30 Mar 2012 02:05:40 +0300 Subject: One part of fixes after auto checking. --- src/gui/widgets/avatarlistbox.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/gui/widgets/avatarlistbox.cpp') diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 749837f7d..b4fc4fad0 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -343,16 +343,15 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) { case AVATAR_PLAYER: { - Being* being = actorSpriteManager->findBeingByName( - model->getAvatarAt(selected)->getName(), Being::PLAYER); - if (being) + Avatar *avatar = model->getAvatarAt(selected); + if (avatar) { - viewport->showPopup(being); - } - else - { - viewport->showPlayerPopup( - model->getAvatarAt(selected)->getName()); + Being* being = actorSpriteManager->findBeingByName( + avatar->getName(), Being::PLAYER); + if (being) + viewport->showPopup(being); + else + viewport->showPlayerPopup(avatar->getName()); } break; } -- cgit v1.2.3-70-g09d2