From f6e76f469a81ff2d9e3714d39d1a8f4012cda2b8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 27 May 2016 23:28:11 +0300 Subject: Fix some false positive asserts in working with hair style equal to zero. --- src/net/eathena/charserverrecv.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/net/eathena/charserverrecv.cpp') diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp index a1417b9c8..fcf90acc9 100644 --- a/src/net/eathena/charserverrecv.cpp +++ b/src/net/eathena/charserverrecv.cpp @@ -141,9 +141,16 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, const ItemColor color = fromInt(msg.readInt16("hair color"), ItemColor); tempPlayer->setHairColor(color); - tempPlayer->setSprite(SPRITE_HAIR_COLOR, hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString( - color)); + if (hairStyle == 0) + { + tempPlayer->setSprite(SPRITE_HAIR_COLOR, 0, std::string()); + } + else + { + tempPlayer->setSprite(SPRITE_HAIR_COLOR, hairStyle * -1, + ItemDB::get(-hairStyle).getDyeColorsString( + color)); + } const uint16_t look = msg.readInt16("clothes color"); tempPlayer->setSubtype(fromInt(race, BeingTypeId), look); -- cgit v1.2.3-60-g2f50