From 06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Sep 2011 02:11:55 +0300 Subject: Add more checks and some code cleanups. --- src/spellmanager.cpp | 2 -- src/spellshortcut.cpp | 2 +- src/text.h | 6 ++++-- src/textcommand.cpp | 2 +- src/units.cpp | 4 +++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index 9f777f9e4..895ac94f2 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -41,7 +41,6 @@ SpellManager::SpellManager() { - //fillSpells(); load(); } @@ -50,7 +49,6 @@ SpellManager::~SpellManager() delete_all(mSpells); mSpells.clear(); mSpellsVector.clear(); -// save(); } TextCommand* SpellManager::getSpell(int spellId) diff --git a/src/spellshortcut.cpp b/src/spellshortcut.cpp index 2c5bd253d..67171524c 100644 --- a/src/spellshortcut.cpp +++ b/src/spellshortcut.cpp @@ -72,4 +72,4 @@ void SpellShortcut::load() unsigned int SpellShortcut::getSpellsCount() const { return SPELL_SHORTCUT_ITEMS; -} \ No newline at end of file +} diff --git a/src/text.h b/src/text.h index 5249be967..2b0eaa97b 100644 --- a/src/text.h +++ b/src/text.h @@ -95,12 +95,14 @@ class FlashText : public Text /** * Remove the text from the screen */ - virtual ~FlashText() {} + virtual ~FlashText() + { } /** * Flash the text for so many refreshes. */ - void flash(int time) {mTime = time; } + void flash(int time) + { mTime = time; } /** * Draws the text. diff --git a/src/textcommand.cpp b/src/textcommand.cpp index 33dff85aa..1402576d1 100644 --- a/src/textcommand.cpp +++ b/src/textcommand.cpp @@ -112,4 +112,4 @@ void TextCommand::loadImage() if (!mImage) mImage = Theme::getImageFromTheme("unknown-item.png"); -} \ No newline at end of file +} diff --git a/src/units.cpp b/src/units.cpp index db9faadd1..edf9c749a 100644 --- a/src/units.cpp +++ b/src/units.cpp @@ -208,8 +208,10 @@ std::string formatUnit(int value, int type) ul = ud.levels[i]; if (ul.count) + { nextAmount = levelAmount / ul.count; - levelAmount %= ul.count; + levelAmount %= ul.count; + } if (levelAmount > 0) output = strprintf("%d%s", levelAmount, pl.symbol.c_str()) + output; -- cgit v1.2.3-70-g09d2