diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-08-05 02:20:34 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-08-05 02:20:34 +0000 |
commit | d25e1c9b0dac7fcfe803083af1189489d5a9ad88 (patch) | |
tree | 330e30558d62c4de99976305390a976fd5f8d958 /src/player.cpp | |
parent | 97f1e5345cc8a88fed9c65035f2b01fc2eaf9cbd (diff) | |
download | mana-d25e1c9b0dac7fcfe803083af1189489d5a9ad88.tar.gz mana-d25e1c9b0dac7fcfe803083af1189489d5a9ad88.tar.bz2 mana-d25e1c9b0dac7fcfe803083af1189489d5a9ad88.tar.xz mana-d25e1c9b0dac7fcfe803083af1189489d5a9ad88.zip |
Some cleanups, mostly lowering indentation levels.
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 20 |
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); |