summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 0c281973..5edbe154 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -459,8 +459,9 @@ void Viewport::mouseMoved(gcn::MouseEvent &event)
const int y = (event.getY() + (int) mPixelViewY);
mHoverBeing = beingManager->findBeingByPixel(x, y);
- if (Player *p = dynamic_cast<Player*>(mHoverBeing))
- mBeingPopup->show(getMouseX(), getMouseY(), p);
+ if (mHoverBeing->getType() == Being::PLAYER)
+ mBeingPopup->show(getMouseX(), getMouseY(),
+ static_cast<Player*>(mHoverBeing));
else
mBeingPopup->setVisible(false);