summaryrefslogtreecommitdiff
path: root/src/net/tmwa/charserverhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-15 13:58:32 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-16 01:52:14 +0300
commit41cc92f73e39cec5dfea6b1164176610cccc7df4 (patch)
tree22fd3d388084d2c61fe80f0441c3c30ab8ffd33c /src/net/tmwa/charserverhandler.cpp
parent7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff)
downloadmanaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.gz
manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.bz2
manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.xz
manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.zip
Add strong typed int for item color.
Diffstat (limited to 'src/net/tmwa/charserverhandler.cpp')
-rw-r--r--src/net/tmwa/charserverhandler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 12d698186..229339ef4 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -168,7 +168,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
const uint16_t look = msg.readUInt8("look");
tempPlayer->setSubtype(fromInt(race, BeingTypeId), look);
const uint16_t weapon = msg.readInt16("weapon");
- tempPlayer->setSprite(SPRITE_BODY, weapon, "", 1, true);
+ tempPlayer->setSprite(SPRITE_BODY, weapon, "", ItemColor_one, true);
data.mAttributes[Attributes::LEVEL] = msg.readInt16("level");
@@ -179,11 +179,12 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
const int hat = msg.readInt16("hat");
const int topClothes = msg.readInt16("top clothes");
- const uint8_t hairColor = msg.readUInt8("hair color");
+ const ItemColor hairColor = fromInt(
+ msg.readUInt8("hair color"), ItemColor);
msg.readUInt8("unused");
tempPlayer->setSprite(SPRITE_HAIR_COLOR, hairStyle * -1,
ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
- tempPlayer->setHairColor(static_cast<unsigned char>(hairColor));
+ tempPlayer->setHairColor(hairColor);
const int misc2 = msg.readInt16("misc2");
tempPlayer->setName(msg.readString(24, "name"));