summaryrefslogtreecommitdiff
path: root/src/gui/charcreatedialog.cpp
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/gui/charcreatedialog.cpp
parent2399c209dd3429ac2629e91d8cd2219e1e15c7db (diff)
downloadManaVerse-05abb208b47329b60a3cbbef86f8bc88f91ab5de.tar.gz
ManaVerse-05abb208b47329b60a3cbbef86f8bc88f91ab5de.tar.bz2
ManaVerse-05abb208b47329b60a3cbbef86f8bc88f91ab5de.tar.xz
ManaVerse-05abb208b47329b60a3cbbef86f8bc88f91ab5de.zip
Fix crash in char creation if client data corrupted.
Diffstat (limited to 'src/gui/charcreatedialog.cpp')
-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)