summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-11-02 02:41:08 +0000
committerIra Rice <irarice@gmail.com>2008-11-02 02:41:08 +0000
commit168eba19e2b4712c8410bd940e3bd1fbba746d1f (patch)
tree8d5dd87b59d65ad1c6f77b42bd95b44ec2c0de60
parent842336f6d028dd8995b777439c9d1bf41f152d0f (diff)
downloadmana-client-168eba19e2b4712c8410bd940e3bd1fbba746d1f.tar.gz
mana-client-168eba19e2b4712c8410bd940e3bd1fbba746d1f.tar.bz2
mana-client-168eba19e2b4712c8410bd940e3bd1fbba746d1f.tar.xz
mana-client-168eba19e2b4712c8410bd940e3bd1fbba746d1f.zip
Fixed a hair color problem that Soft reported that I apparently broke when I de-hardcoded the hair colors.
-rw-r--r--src/being.cpp2
-rw-r--r--src/player.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/being.cpp b/src/being.cpp
index b4e7847d..5c09218c 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -160,7 +160,7 @@ void Being::setPath(const Path &path)
void Being::setHairStyle(int style, int color)
{
mHairStyle = style < 0 ? mHairStyle : style % mNumberOfHairstyles;
- mHairColor = color;
+ mHairColor = color < 0 ? mHairColor : color % ColorDB::size();
}
void Being::setSprite(int slot, int id, std::string color)
diff --git a/src/player.cpp b/src/player.cpp
index c9d1e683..5fb5ffe9 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -160,6 +160,7 @@ void Player::setGender(int gender)
void Player::setHairStyle(int style, int color)
{
style = style < 0 ? mHairStyle : style % mNumberOfHairstyles;
+ color = color < 0 ? mHairColor : color % ColorDB::size();
if (style == mHairStyle && color == mHairColor) return;
Being::setHairStyle(style, color);