diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-27 23:28:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-27 23:28:11 +0300 |
commit | f6e76f469a81ff2d9e3714d39d1a8f4012cda2b8 (patch) | |
tree | cf512c32dbc37283ce8c16901fb4df0082508d28 /src/actormanager.cpp | |
parent | cd327e877804a824db51d1e0831ad9e13b0e18b3 (diff) | |
download | plus-f6e76f469a81ff2d9e3714d39d1a8f4012cda2b8.tar.gz plus-f6e76f469a81ff2d9e3714d39d1a8f4012cda2b8.tar.bz2 plus-f6e76f469a81ff2d9e3714d39d1a8f4012cda2b8.tar.xz plus-f6e76f469a81ff2d9e3714d39d1a8f4012cda2b8.zip |
Fix some false positive asserts in working with hair style equal to zero.
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r-- | src/actormanager.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp index 020d3a9f5..82be50ea8 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -2043,8 +2043,16 @@ Being *ActorManager::cloneBeing(const Being *const srcBeing, const int hairSlot = charServerHandler->hairSprite(); const int hairStyle = -srcBeing->getSpriteID(hairSlot); const ItemColor hairColor = srcBeing->getHairColor(); - dstBeing->setSprite(hairSlot, hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); + if (hairStyle != 0) + { + dstBeing->setSprite(hairSlot, + hairStyle * -1, + ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); + } + else + { + dstBeing->setSprite(hairSlot, 0, std::string()); + } dstBeing->setHairColor(hairColor); return dstBeing; } |