summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-23 01:10:17 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-23 01:10:17 +0300
commitba0b0d3891e0ac88cb6313155a456efd0f7c326f (patch)
treeec51607feba3d9b6bb0049f08fd5712042c23028
parent245fde2b81644110558e05cf1838ef819e2e77db (diff)
downloadplus-ba0b0d3891e0ac88cb6313155a456efd0f7c326f.tar.gz
plus-ba0b0d3891e0ac88cb6313155a456efd0f7c326f.tar.bz2
plus-ba0b0d3891e0ac88cb6313155a456efd0f7c326f.tar.xz
plus-ba0b0d3891e0ac88cb6313155a456efd0f7c326f.zip
Dont show assert if for player set hair color without hair sprite.
-rw-r--r--src/being/being.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index f020de3da..b7f545918 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2615,8 +2615,13 @@ void Being::setHairColor(const unsigned int slot,
const ItemColor color) restrict2
{
mHairColor = color;
- setSprite(slot, mSpriteIDs[slot], ItemDB::get(
- getSpriteID(slot)).getDyeColorsString(color));
+ const int id = getSpriteID(slot);
+ if (id != 0)
+ {
+ setSprite(slot,
+ mSpriteIDs[slot],
+ ItemDB::get(id).getDyeColorsString(color));
+ }
}
void Being::dumpSprites() const restrict2