summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-08-02 15:48:17 -0600
committerJared Adams <jaxad0127@gmail.com>2010-08-02 15:48:17 -0600
commit6caf60e9b698a117a8518301f3de65b24e7d876b (patch)
treee33dad42dadd4e0526022286ee5bfa98b3b5d9d9 /src/gui/viewport.cpp
parent0cc6b3bde2d9d041cf8c616941a11273dae2aff5 (diff)
downloadmana-6caf60e9b698a117a8518301f3de65b24e7d876b.tar.gz
mana-6caf60e9b698a117a8518301f3de65b24e7d876b.tar.bz2
mana-6caf60e9b698a117a8518301f3de65b24e7d876b.tar.xz
mana-6caf60e9b698a117a8518301f3de65b24e7d876b.zip
Fix some bugs
Trivial fixes.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index b6e4f71d..f63fe5c6 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -495,11 +495,13 @@ void Viewport::mouseMoved(gcn::MouseEvent &event)
const int x = (event.getX() + (int) mPixelViewX);
const int y = (event.getY() + (int) mPixelViewY);
- mHoverBeing->removeActorSpriteListener(this);
+ if (mHoverBeing)
+ mHoverBeing->removeActorSpriteListener(this);
mHoverBeing = actorSpriteManager->findBeingByPixel(x, y);
mBeingPopup->show(getMouseX(), getMouseY(), mHoverBeing);
- mHoverItem->removeActorSpriteListener(this);
+ if (mHoverItem)
+ mHoverItem->removeActorSpriteListener(this);
mHoverItem = actorSpriteManager->findItem(x / mMap->getTileWidth(),
y / mMap->getTileHeight());