summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-09-17 02:14:12 +0200
committerBertram <bertram@cegetel.net>2009-09-17 02:14:12 +0200
commitfde41392cde408af9ea269e00336e503294dfdd2 (patch)
treefbdda716c1d441b7d85e686e054e3346396a144d /src/player.cpp
parent78134dc88b0b39b0d051392fa937418bcd384404 (diff)
downloadmana-fde41392cde408af9ea269e00336e503294dfdd2.tar.gz
mana-fde41392cde408af9ea269e00336e503294dfdd2.tar.bz2
mana-fde41392cde408af9ea269e00336e503294dfdd2.tar.xz
mana-fde41392cde408af9ea269e00336e503294dfdd2.zip
Partially (but mainly) resolved Mantis #753 by making monsters, NPC, and Floor Items visible even covered.
Next Step would be to add a caching system for multi-layered sprites + copy functions for SDL and OpenGL. Then, I'll be able to finish this, by making also players visible when covered... But Kage asked me (each and every hour) to do something else first ;)
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 288c565d..d252f7a0 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -184,7 +184,8 @@ void Player::setSprite(unsigned int slot, int id, const std::string &color)
if (equipmentSprite)
equipmentSprite->setDirection(getSpriteDirection());
- delete mSprites[slot];
+ if (mSprites[slot])
+ delete mSprites[slot];
mSprites[slot] = equipmentSprite;
@@ -196,6 +197,8 @@ void Player::setSprite(unsigned int slot, int id, const std::string &color)
mSpriteIDs[slot] = id;
mSpriteColors[slot] = color;
+
+ _updateNumberOfLayers();
}
void Player::setSpriteID(unsigned int slot, int id)