diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-14 02:11:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-14 02:11:55 +0300 |
commit | 06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20 (patch) | |
tree | c884e11767b57bfaffd0643324d146dbdfe16a8b /src/units.cpp | |
parent | c0a5fffb45f849e224750f27fa8c3be5ac447ad6 (diff) | |
download | manaplus-06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20.tar.gz manaplus-06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20.tar.bz2 manaplus-06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20.tar.xz manaplus-06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20.zip |
Add more checks and some code cleanups.
Diffstat (limited to 'src/units.cpp')
-rw-r--r-- | src/units.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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; |