summaryrefslogtreecommitdiff
path: root/src/net/tmwa/charserverhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa/charserverhandler.cpp')
-rw-r--r--src/net/tmwa/charserverhandler.cpp6
1 files changed, 4 insertions, 2 deletions
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<unsigned char>(hairColor));
const int misc2 = msg.readInt16();
tempPlayer->setName(msg.readString(24));