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/tmwa/charserverrecv.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/net/tmwa/charserverrecv.cpp') diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp index 5032e4c39..428693678 100644 --- a/src/net/tmwa/charserverrecv.cpp +++ b/src/net/tmwa/charserverrecv.cpp @@ -118,8 +118,18 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, const ItemColor hairColor = fromInt( msg.readUInt8("hair color"), ItemColor); msg.readUInt8("unused"); - tempPlayer->setSprite(SPRITE_HAIR_COLOR, hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); + if (hairStyle == 0) + { + tempPlayer->setSprite(SPRITE_HAIR_COLOR, + 0, + std::string()); + } + else + { + tempPlayer->setSprite(SPRITE_HAIR_COLOR, + hairStyle * -1, + ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); + } tempPlayer->setHairColor(hairColor); const int misc2 = msg.readInt16("misc2"); -- cgit v1.2.3-70-g09d2