diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-09 20:14:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-09 20:14:21 +0300 |
commit | ecef66ec4e58ac44fe3d144c5157e799173cef91 (patch) | |
tree | 01ff0dda74e8b227233e11846c4b458e9623ee85 /src/net/tmwa/charserverrecv.cpp | |
parent | 13ec103b3e76c3750993905413a8ac72383176c3 (diff) | |
download | manaplus-ecef66ec4e58ac44fe3d144c5157e799173cef91.tar.gz manaplus-ecef66ec4e58ac44fe3d144c5157e799173cef91.tar.bz2 manaplus-ecef66ec4e58ac44fe3d144c5157e799173cef91.tar.xz manaplus-ecef66ec4e58ac44fe3d144c5157e799173cef91.zip |
Add per char gender into tmwa.
Diffstat (limited to 'src/net/tmwa/charserverrecv.cpp')
-rw-r--r-- | src/net/tmwa/charserverrecv.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp index 6c47f5e05..8f8498a37 100644 --- a/src/net/tmwa/charserverrecv.cpp +++ b/src/net/tmwa/charserverrecv.cpp @@ -34,6 +34,7 @@ #include "net/character.h" #include "net/charserverhandler.h" #include "net/messagein.h" +#include "net/serverfeatures.h" #include "net/ea/token.h" @@ -71,7 +72,6 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, LocalPlayer *const tempPlayer = new LocalPlayer( msg.readBeingId("account id"), BeingTypeId_zero); - tempPlayer->setGender(token.sex); PlayerInfoBackend &data = character->data; data.mAttributes[Attributes::EXP] = msg.readInt32("exp"); @@ -145,7 +145,11 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, tempPlayer->setSprite(SPRITE_HEAD_MID, misc2); character->slot = msg.readUInt8("slot"); - msg.readUInt8("unused"); + const uint8_t sex = static_cast<uint8_t>(msg.readUInt8("gender")); + if (serverFeatures->haveCreateCharGender()) + tempPlayer->setGender(Being::intToGender(sex)); + else + tempPlayer->setGender(token.sex); } void CharServerRecv::processCharLogin(Net::MessageIn &msg) |