summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/charcreatedialog.cpp10
-rw-r--r--src/gui/palette.cpp2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index c32098b63..b0a7d730c 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -159,8 +159,14 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
if (!maxHairStyle)
maxHairStyle = mPlayer->getNumOfHairstyles();
- mHairStyle = (rand() % maxHairStyle) + minHairStyle;
- mHairColor = (rand() % maxHairColor) + minHairColor;
+ if (maxHairStyle)
+ mHairStyle = (rand() % maxHairStyle) + minHairStyle;
+ else
+ mHairStyle = 0;
+ if (maxHairColor)
+ mHairColor = (rand() % maxHairColor) + minHairColor;
+ else
+ mHairColor = 0;
mNameField->setMaximum(24);
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index abd328458..1b25620a9 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -127,7 +127,7 @@ void Palette::advanceGradient()
% (delay * numOfColors);
const int gradIndex = elem->gradientIndex;
- const int pos = gradIndex % delay;
+ const int pos = delay ? (gradIndex % delay) : gradIndex;
int colIndex;
if (delay)
colIndex = gradIndex / delay;