summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/charcreatedialog.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 02ff66354..ddd6ac873 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -166,13 +166,23 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
maxHairStyle = mPlayer->getNumOfHairstyles();
if (maxHairStyle)
- mHairStyle = (rand() % maxHairStyle) + minHairStyle;
+ {
+ mHairStyle = (static_cast<unsigned int>(rand())
+ % maxHairStyle) + minHairStyle;
+ }
else
+ {
mHairStyle = 0;
+ }
if (maxHairColor)
- mHairColor = (rand() % maxHairColor) + minHairColor;
+ {
+ mHairColor = (static_cast<unsigned int>(rand())
+ % maxHairColor) + minHairColor;
+ }
else
+ {
mHairColor = 0;
+ }
mNameField->setMaximum(24);