From 4cffca0da71771d0d51ba4cd4842d2d93aa2946e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 2 Oct 2012 21:38:23 +0300 Subject: Fix some conversions. --- src/net/tmwa/charserverhandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/net/tmwa/charserverhandler.cpp') diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 4e3763042..e8c9dfaff 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -217,10 +217,12 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, const int hat = msg.readInt16(); // head option top const int topClothes = msg.readInt16(); - const int hairColor = msg.readInt16(); + int hairColor = msg.readInt16(); + if (hairColor > 255) + hairColor = 255; tempPlayer->setSprite(SPRITE_HAIR, hairStyle * -1, ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - tempPlayer->setHairColor(hairColor); + tempPlayer->setHairColor(static_cast(hairColor)); const int misc2 = msg.readInt16(); tempPlayer->setName(msg.readString(24)); -- cgit v1.2.3-60-g2f50