summaryrefslogtreecommitdiff
path: root/src/gui/charcreatedialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-25 14:46:53 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-25 14:47:37 +0300
commit0f6b7350ad0305d518fb75a8aa07f0616178ede5 (patch)
tree2e12990ad04106660fbe31547480d8976d1215d7 /src/gui/charcreatedialog.cpp
parent5da20a82b1a4d1a4bab77fad0aa73244a53073b1 (diff)
downloadmv-0f6b7350ad0305d518fb75a8aa07f0616178ede5.tar.gz
mv-0f6b7350ad0305d518fb75a8aa07f0616178ede5.tar.bz2
mv-0f6b7350ad0305d518fb75a8aa07f0616178ede5.tar.xz
mv-0f6b7350ad0305d518fb75a8aa07f0616178ede5.zip
fix previous/next race button in char creation dialog.
Diffstat (limited to 'src/gui/charcreatedialog.cpp')
-rw-r--r--src/gui/charcreatedialog.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index 33806753d..8315bed02 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -538,17 +538,10 @@ void CharCreateDialog::updateRace()
{
int id;
if (mRace < 0)
- {
+ mRace = Being::getNumOfRaces() - 1;
+ else if (mRace >= Being::getNumOfRaces())
mRace = 0;
- id = -100;
- }
- else
- {
- id = -100 - mRace;
- while (id < -100 && !ItemDB::exists(id))
- id ++;
- mRace = -100 - id;
- }
+ id = -100 - mRace;
mPlayer->setSubtype(static_cast<uint16_t>(mRace));
const ItemInfo &item = ItemDB::get(id);