summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 2e119e2d..c626fd09 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -107,11 +107,7 @@ Player::setHairColor(Uint16 color)
{
if (color != mHairColor && mHairStyle > 0)
{
- if (mSprites[HAIR_SPRITE])
- {
- delete mSprites[HAIR_SPRITE];
- }
-
+ delete mSprites[HAIR_SPRITE];
AnimatedSprite *newHairSprite = new AnimatedSprite(
"graphics/sprites/hairstyle" + toString(mHairStyle) + ".xml",
color - 1);
@@ -130,11 +126,7 @@ Player::setHairStyle(Uint16 style)
{
if (style != mHairStyle && mHairColor > 0)
{
- if (mSprites[HAIR_SPRITE])
- {
- delete mSprites[HAIR_SPRITE];
- }
-
+ delete mSprites[HAIR_SPRITE];
AnimatedSprite *newHairSprite = new AnimatedSprite(
"graphics/sprites/hairstyle" + toString(style) + ".xml",
mHairColor - 1);
@@ -164,11 +156,11 @@ Player::setVisibleEquipment(Uint8 slot, Uint8 id)
position = TOPCLOTHES_SPRITE;
break;
}
+
+ delete mSprites[position];
+ mSprites[position] = NULL;
+
// id = 0 means unequip
- if (mSprites[position]) {
- delete mSprites[position];
- mSprites[position] = NULL;
- }
if (id) {
char stringId[4];
sprintf(stringId, "%03i", id);