diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-23 01:10:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-23 01:10:17 +0300 |
commit | ba0b0d3891e0ac88cb6313155a456efd0f7c326f (patch) | |
tree | ec51607feba3d9b6bb0049f08fd5712042c23028 /src/being/being.cpp | |
parent | 245fde2b81644110558e05cf1838ef819e2e77db (diff) | |
download | ManaVerse-ba0b0d3891e0ac88cb6313155a456efd0f7c326f.tar.gz ManaVerse-ba0b0d3891e0ac88cb6313155a456efd0f7c326f.tar.bz2 ManaVerse-ba0b0d3891e0ac88cb6313155a456efd0f7c326f.tar.xz ManaVerse-ba0b0d3891e0ac88cb6313155a456efd0f7c326f.zip |
Dont show assert if for player set hair color without hair sprite.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 9 |
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 |