diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-18 16:13:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-18 17:40:26 +0300 |
commit | 68d6ec7e0e2877874da5a25297fc7a0a6f433267 (patch) | |
tree | 5d81b72d741e27c606b2e5828f10307a915b83a7 | |
parent | 1a596fbbf8e539de2ba68b6715478806943a1bf1 (diff) | |
download | plus-68d6ec7e0e2877874da5a25297fc7a0a6f433267.tar.gz plus-68d6ec7e0e2877874da5a25297fc7a0a6f433267.tar.bz2 plus-68d6ec7e0e2877874da5a25297fc7a0a6f433267.tar.xz plus-68d6ec7e0e2877874da5a25297fc7a0a6f433267.zip |
Fix assert in sethair function. If some one set hair with id 0.
-rw-r--r-- | src/being/being.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 11deec011..5ad4a1006 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -3212,11 +3212,18 @@ void Being::setSpriteColor(const unsigned int slot, void Being::setHairStyle(const unsigned int slot, const int id) restrict2 { -// dumpSprites(); - setSpriteColor(slot, - id, - ItemDB::get(id).getDyeColorsString(mHairColor)); -// dumpSprites(); + if (id != 0) + { + setSpriteColor(slot, + id, + ItemDB::get(id).getDyeColorsString(mHairColor)); + } + else + { + setSpriteColor(slot, + 0, + std::string()); + } } void Being::setHairColor(const unsigned int slot, |