diff options
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/player.cpp b/src/player.cpp index f86e7179..0e88da0b 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -140,27 +140,13 @@ void Player::setGender(int gender) void Player::setHairStyle(int style, int color) { - style = style < 0 ? mHairStyle : style % NR_HAIR_STYLES; - color = color < 0 ? mHairColor : color % NR_HAIR_COLORS; + style = style < 0 ? mHairStyle : style % getHairStylesNr(); + color = color < 0 ? mHairColor : color % getHairColorsNr(); if (style == mHairStyle && color == mHairColor) return; Being::setHairStyle(style, color); - static char const *const colors[NR_HAIR_COLORS] = - { - "#8c4b41,da9041,ffffff", // light brown - "#06372b,489e25,fdedcc", // green - "#5f0b33,91191c,f9ad81", // red - "#602486,934cc3,fdc689", // purple - "#805e74,c6b09b,ffffff", // gray - "#8c6625,dab425,ffffff", // yellow - "#1d2d6d,1594a3,fdedcc", // blue - "#831f2d,be4f2d,f8cc8b", // brown - "#432482,584bbc,dae8e5", // light blue - "#460850,611967,e7b4ae", // dark purple - }; - - setSprite(HAIR_SPRITE, style * -1, colors[color]); + setSprite(HAIR_SPRITE, style * -1, getHairColor(color)); setAction(mAction); } @@ -209,3 +195,5 @@ void Player::updateCoords() mName->adviseXY(mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET); } } + + |