summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/charcreatedialog.cpp12
-rw-r--r--src/gui/windows/charcreatedialog.h2
2 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 64346eabe..fe22b0317 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -130,10 +130,12 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
mGenderStrip(nullptr),
mMaxPoints(0),
mUsedPoints(0),
- mRace(0),
+ mRace(CharDB::getMinRace()),
mLook(0),
mMinLook(CharDB::getMinLook()),
mMaxLook(CharDB::getMaxLook()),
+ mMinRace(CharDB::getMinRace()),
+ mMaxRace(CharDB::getMaxRace()),
mHairStyle(0),
mHairColor(0),
mSlot(slot),
@@ -619,10 +621,10 @@ void CharCreateDialog::updateHair()
void CharCreateDialog::updateRace()
{
- if (mRace < 0)
- mRace = Being::getNumOfRaces() - 1;
- else if (mRace >= Being::getNumOfRaces())
- mRace = 0;
+ if (mRace < mMinRace)
+ mRace = mMaxRace;
+ else if (mRace > mMaxRace)
+ mRace = mMinRace;
updateLook();
}
diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h
index 45555f869..d179982ad 100644
--- a/src/gui/windows/charcreatedialog.h
+++ b/src/gui/windows/charcreatedialog.h
@@ -148,6 +148,8 @@ class CharCreateDialog final : public Window,
int mLook;
int mMinLook;
int mMaxLook;
+ int mMinRace;
+ int mMaxRace;
int mHairStyle;
int mHairColor;