summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-24 17:42:53 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-24 17:42:53 +0300
commit05abb208b47329b60a3cbbef86f8bc88f91ab5de (patch)
treef4514088817583404ab32538cfb51b342ba9da51 /src
parent2399c209dd3429ac2629e91d8cd2219e1e15c7db (diff)
downloadplus-05abb208b47329b60a3cbbef86f8bc88f91ab5de.tar.gz
plus-05abb208b47329b60a3cbbef86f8bc88f91ab5de.tar.bz2
plus-05abb208b47329b60a3cbbef86f8bc88f91ab5de.tar.xz
plus-05abb208b47329b60a3cbbef86f8bc88f91ab5de.zip
Fix crash in char creation if client data corrupted.
Diffstat (limited to 'src')
-rw-r--r--src/gui/charcreatedialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index 52e59f095..6a2ad0bf3 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -501,7 +501,10 @@ void CharCreateDialog::updateHair()
mHairStyleNameLabel->setCaption(item.getName());
mHairStyleNameLabel->adjustSize();
- mHairColor %= ColorDB::getHairSize();
+ if (ColorDB::getHairSize())
+ mHairColor %= ColorDB::getHairSize();
+ else
+ mHairColor = 0;
if (mHairColor < 0)
mHairColor += ColorDB::getHairSize();
if (mHairColor < static_cast<signed>(minHairColor)