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/skilldialog.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/skilldialog.cpp')
-rw-r--r-- | src/gui/skilldialog.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 943bda3a..0a5b8d71 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -138,11 +138,11 @@ public: void draw(gcn::Graphics *gcnGraphics) { - SkillModel* model = dynamic_cast<SkillModel*>(mListModel); - - if (!model) + if (!mListModel) return; + SkillModel* model = static_cast<SkillModel*>(mListModel); + updateAlpha(); Graphics *graphics = static_cast<Graphics*>(gcnGraphics); @@ -226,13 +226,9 @@ void SkillDialog::action(const gcn::ActionEvent &event) { if (event.getId() == "inc") { - SkillTab *tab = dynamic_cast<SkillTab*>(mTabs->getSelectedTab()); - - if (tab) - { - if (SkillInfo *info = tab->getSelectedInfo()) - Net::getPlayerHandler()->increaseSkill(info->id); - } + SkillTab *tab = static_cast<SkillTab*>(mTabs->getSelectedTab()); + if (SkillInfo *info = tab->getSelectedInfo()) + Net::getPlayerHandler()->increaseSkill(info->id); } else if (event.getId() == "close") { |