diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-08-02 15:48:17 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-02 15:48:17 -0600 |
commit | 6caf60e9b698a117a8518301f3de65b24e7d876b (patch) | |
tree | e33dad42dadd4e0526022286ee5bfa98b3b5d9d9 | |
parent | 0cc6b3bde2d9d041cf8c616941a11273dae2aff5 (diff) | |
download | mana-6caf60e9b698a117a8518301f3de65b24e7d876b.tar.gz mana-6caf60e9b698a117a8518301f3de65b24e7d876b.tar.bz2 mana-6caf60e9b698a117a8518301f3de65b24e7d876b.tar.xz mana-6caf60e9b698a117a8518301f3de65b24e7d876b.zip |
Fix some bugs
Trivial fixes.
-rw-r--r-- | src/actorspritemanager.cpp | 3 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp index 2a57c21a..288c772f 100644 --- a/src/actorspritemanager.cpp +++ b/src/actorspritemanager.cpp @@ -206,7 +206,10 @@ void ActorSpriteManager::logic() for (it = mDeleteActors.begin(), it_end = mDeleteActors.end(); it != it_end; ++it) + { + mActors.erase(*it); delete *it; + } mDeleteActors.clear(); } 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()); |