diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-16 20:39:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-16 20:39:33 +0300 |
commit | bc92643d8db723b5049db2dbad1ce052a0ae77a9 (patch) | |
tree | 4471be99711ee310c811e990d7c210e2393aeb6e /src/gui/specialswindow.cpp | |
parent | 82cc576b7896f39bcf71aa85c8c4b3ef786c065b (diff) | |
download | manaplus-bc92643d8db723b5049db2dbad1ce052a0ae77a9.tar.gz manaplus-bc92643d8db723b5049db2dbad1ce052a0ae77a9.tar.bz2 manaplus-bc92643d8db723b5049db2dbad1ce052a0ae77a9.tar.xz manaplus-bc92643d8db723b5049db2dbad1ce052a0ae77a9.zip |
Fix code style and some other minor issues.
Diffstat (limited to 'src/gui/specialswindow.cpp')
-rw-r--r-- | src/gui/specialswindow.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/specialswindow.cpp b/src/gui/specialswindow.cpp index cead5ebb6..b1d105aeb 100644 --- a/src/gui/specialswindow.cpp +++ b/src/gui/specialswindow.cpp @@ -105,10 +105,10 @@ void SpecialsWindow::action(const gcn::ActionEvent &event) if (!event.getSource()) return; - SpecialEntry *disp = dynamic_cast<SpecialEntry*>( + const SpecialEntry *const disp = dynamic_cast<SpecialEntry*>( event.getSource()->getParent()); - if (disp) + if (disp && disp->mInfo) { /*Being *target = player_node->getTarget(); @@ -171,12 +171,12 @@ void SpecialsWindow::rebuild(const std::map<int, Special> &specialData) { logger->log("Updating special GUI for %d", i->first); - SpecialInfo* info = SpecialDB::get(i->first); + SpecialInfo *const info = SpecialDB::get(i->first); if (info) { info->rechargeCurrent = i->second.currentMana; info->rechargeNeeded = i->second.neededMana; - SpecialEntry* entry = new SpecialEntry(info); + SpecialEntry *const entry = new SpecialEntry(info); entry->setPosition(0, vPos); vPos += entry->getHeight(); add(entry); @@ -190,7 +190,7 @@ void SpecialsWindow::rebuild(const std::map<int, Special> &specialData) } -SpecialEntry::SpecialEntry(SpecialInfo *info) : +SpecialEntry::SpecialEntry(SpecialInfo *const info) : mInfo(info), mIcon(nullptr), mLevelLabel(nullptr), @@ -251,8 +251,7 @@ void SpecialEntry::update(int current, int needed) { if (mRechargeBar && needed) { - float progress = static_cast<float>(current) - / static_cast<float>(needed); - mRechargeBar->setProgress(progress); + mRechargeBar->setProgress(static_cast<float>(current) + / static_cast<float>(needed)); } } |