diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-25 23:45:27 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-26 06:53:05 -0600 |
commit | 3be9cace41bcef4b7bf55bffea5d3596bd588e7e (patch) | |
tree | 174cb77c11ddf755eaea52bba836b496d177ff91 /src/gui/viewport.cpp | |
parent | 48754058d7be3f433734cb1524e9e74cfd4fd55f (diff) | |
download | mana-3be9cace41bcef4b7bf55bffea5d3596bd588e7e.tar.gz mana-3be9cace41bcef4b7bf55bffea5d3596bd588e7e.tar.bz2 mana-3be9cace41bcef4b7bf55bffea5d3596bd588e7e.tar.xz mana-3be9cace41bcef4b7bf55bffea5d3596bd588e7e.zip |
Replace most dynamic_casts with static_casts
The remaining instances can't easily or safely be changed as the classes
involved don't have type information like Being does.
Reviewed-by: Freeyorp
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 5 |
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); |