From b6df3c3999d4be067e7314e3887e583c13ad1624 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 10 Jun 2013 22:46:50 +0300 Subject: add partial support for player looks. Can get packets from server, but cant draw player. --- src/net/tmwa/charserverhandler.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/net/tmwa/charserverhandler.cpp') diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 10be5edf8..68699e327 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -157,11 +157,12 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, data.mAttributes[PlayerInfo::MP] = msg.readInt16(); data.mAttributes[PlayerInfo::MAX_MP] = msg.readInt16(); - msg.readInt16(); // speed - tempPlayer->setSubtype(msg.readInt16()); // class (used for race) + msg.readInt16(); // speed + const int race = msg.readInt16(); // class (used for race) const int hairStyle = msg.readInt8(); - msg.readInt8(); // free - const uint16_t weapon = msg.readInt16(); // unused on server. need use? + const int look = msg.readInt8(); + tempPlayer->setSubtype(race, look); + const uint16_t weapon = msg.readInt16(); // unused on server. need use? tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", 1, true); data.mAttributes[PlayerInfo::LEVEL] = msg.readInt16(); @@ -258,7 +259,7 @@ void CharServerHandler::newCharacter(const std::string &name, const int slot, outMsg.writeInt8(static_cast(hairColor)); outMsg.writeInt8(0); // unused outMsg.writeInt8(static_cast(hairstyle)); - outMsg.writeInt8(0); // unused + outMsg.writeInt8(123); // look if (serverVersion >= 2) outMsg.writeInt8(race); } -- cgit v1.2.3-60-g2f50