summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-18 16:13:14 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-18 17:40:26 +0300
commit68d6ec7e0e2877874da5a25297fc7a0a6f433267 (patch)
tree5d81b72d741e27c606b2e5828f10307a915b83a7 /src
parent1a596fbbf8e539de2ba68b6715478806943a1bf1 (diff)
downloadmv-68d6ec7e0e2877874da5a25297fc7a0a6f433267.tar.gz
mv-68d6ec7e0e2877874da5a25297fc7a0a6f433267.tar.bz2
mv-68d6ec7e0e2877874da5a25297fc7a0a6f433267.tar.xz
mv-68d6ec7e0e2877874da5a25297fc7a0a6f433267.zip
Fix assert in sethair function. If some one set hair with id 0.
Diffstat (limited to 'src')
-rw-r--r--src/being/being.cpp17
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,