summaryrefslogtreecommitdiff
path: root/src/gui/char_select.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-10 23:42:55 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-10 23:42:55 +0000
commit9c8e872f2cb8c8dd919eff61a4ce9d63b041f715 (patch)
treee2461fd6df6499ea1d7a1ec5f1d92179a77652ab /src/gui/char_select.cpp
parent3fe5d486bf33d4658ab75b49fe878a9a0394d835 (diff)
downloadmana-9c8e872f2cb8c8dd919eff61a4ce9d63b041f715.tar.gz
mana-9c8e872f2cb8c8dd919eff61a4ce9d63b041f715.tar.bz2
mana-9c8e872f2cb8c8dd919eff61a4ce9d63b041f715.tar.xz
mana-9c8e872f2cb8c8dd919eff61a4ce9d63b041f715.zip
Accepted bugfixes for character creation from Rogier Polak.
Diffstat (limited to 'src/gui/char_select.cpp')
-rw-r--r--src/gui/char_select.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 3cb42078..ec4dad2e 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -238,8 +238,8 @@ CharCreateDialog::CharCreateDialog(Window *parent, int slot):
Window("Create Character", true, parent), mSlot(slot)
{
mPlayer = new Player(0, 0, NULL);
- mPlayer->setHairStyle(rand() % NR_HAIR_STYLES + 1);
- mPlayer->setHairColor(rand() % NR_HAIR_COLORS + 1);
+ mPlayer->setHairStyle(rand() % NR_HAIR_STYLES);
+ mPlayer->setHairColor(rand() % NR_HAIR_COLORS);
mNameField = new TextField("");
mNameLabel = new gcn::Label("Name:");
@@ -326,18 +326,18 @@ void CharCreateDialog::action(const std::string &eventId, gcn::Widget *widget)
scheduleDelete();
}
else if (eventId == "nextcolor") {
- mPlayer->setHairColor(mPlayer->getHairColor() % NR_HAIR_COLORS + 1);
+ mPlayer->setHairColor((mPlayer->getHairColor() + 1) % NR_HAIR_COLORS);
}
else if (eventId == "prevcolor") {
- int prevColor = mPlayer->getHairColor() + NR_HAIR_COLORS - 2;
- mPlayer->setHairColor(prevColor % NR_HAIR_COLORS + 1);
+ int prevColor = mPlayer->getHairColor() + NR_HAIR_COLORS - 1;
+ mPlayer->setHairColor(prevColor % NR_HAIR_COLORS);
}
else if (eventId == "nextstyle") {
- mPlayer->setHairStyle(mPlayer->getHairStyle() % NR_HAIR_STYLES + 1);
+ mPlayer->setHairStyle((mPlayer->getHairStyle() + 1) % NR_HAIR_STYLES);
}
else if (eventId == "prevstyle") {
- int prevStyle = mPlayer->getHairStyle() + NR_HAIR_STYLES - 2;
- mPlayer->setHairStyle(prevStyle % NR_HAIR_STYLES + 1);
+ int prevStyle = mPlayer->getHairStyle() + NR_HAIR_STYLES - 1;
+ mPlayer->setHairStyle(prevStyle % NR_HAIR_STYLES);
}
}