summaryrefslogtreecommitdiff
path: root/src/gui/widgets/characterviewnormal.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-29 12:07:58 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-29 12:07:58 +0300
commita4d15a399a806be0e87a52508e05f07219b26c65 (patch)
tree1cf72137c67182d89d4f6c594397b5eec4d2d2ef /src/gui/widgets/characterviewnormal.cpp
parent6bf17889536c4c3e09bfc2089e0fa1123d8d2378 (diff)
downloadmanaverse-a4d15a399a806be0e87a52508e05f07219b26c65.tar.gz
manaverse-a4d15a399a806be0e87a52508e05f07219b26c65.tar.bz2
manaverse-a4d15a399a806be0e87a52508e05f07219b26c65.tar.xz
manaverse-a4d15a399a806be0e87a52508e05f07219b26c65.zip
fix crach in tmw like servers on player selection dialog.
Diffstat (limited to 'src/gui/widgets/characterviewnormal.cpp')
-rw-r--r--src/gui/widgets/characterviewnormal.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/widgets/characterviewnormal.cpp b/src/gui/widgets/characterviewnormal.cpp
index 920fde61c..7422f25d5 100644
--- a/src/gui/widgets/characterviewnormal.cpp
+++ b/src/gui/widgets/characterviewnormal.cpp
@@ -68,6 +68,7 @@ void CharacterViewNormal::show(const int i)
void CharacterViewNormal::resize()
{
+ const int sz = static_cast<signed>(mCharacterEntries->size());
const CharacterDisplay *const firtChar = (*mCharacterEntries)[0];
int y = 0;
const int width = firtChar->getWidth();
@@ -76,7 +77,7 @@ void CharacterViewNormal::resize()
(*mCharacterEntries)[f]->setPosition(f * width, y);
y += height;
- for (int f = 5; f < 10; f ++)
+ for (int f = 5; f < sz; f ++)
(*mCharacterEntries)[f]->setPosition((f - 5) * width, y);
}