summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/player.cpp b/src/player.cpp
index a1a86587..3d8a8b6e 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -153,8 +153,15 @@ void Player::setSprite(int slot, int id, std::string color)
}
else
{
- AnimatedSprite *equipmentSprite = AnimatedSprite::load(
- "graphics/sprites/" + ItemDB::get(id).getSprite(mGender) + "|" + color);
+ std::string filename = ItemDB::get(id).getSprite(mGender);
+ AnimatedSprite *equipmentSprite = NULL;
+
+ if (filename != "")
+ {
+ if (color!="") filename += "|" + color;
+ equipmentSprite = AnimatedSprite::load(
+ "graphics/sprites/" + filename);
+ }
if (equipmentSprite)
equipmentSprite->setDirection(getSpriteDirection());