From e0af6cf371bedcfedcba2fb23e166ff5d345c447 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 9 Jul 2011 00:05:38 +0300 Subject: Reserve bits in gender field for future usage. --- src/net/ea/beinghandler.cpp | 3 +++ src/net/tmwa/beinghandler.cpp | 5 +++-- src/net/tmwa/charserverhandler.cpp | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index c6606fda8..ee070593f 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -239,6 +239,9 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, bool visible) msg.readInt8(); // karma gender = msg.readInt8(); + // reserving bits for future usage + gender &= 1; + if (dstBeing->getType() == ActorSprite::PLAYER) { dstBeing->setGender((gender == 0) diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 7589553ff..d6f67f716 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -511,8 +511,9 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, int msgType) msg.readInt16(); // manner dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3 msg.readInt8(); // karma - dstBeing->setGender((msg.readInt8() == 0) - ? GENDER_FEMALE : GENDER_MALE); + // reserving bit for future usage + dstBeing->setGender(((msg.readInt8() & 1) == 0) + ? GENDER_FEMALE : GENDER_MALE); // Set these after the gender, as the sprites may be gender-specific dstBeing->setSprite(SPRITE_WEAPON, weapon, "", 1, true); diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 0a28a9a8c..3d605b1ff 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -273,7 +273,8 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, static_cast(Net::getLoginHandler())->getToken(); LocalPlayer *tempPlayer = new LocalPlayer(msg.readInt32(), 0); - tempPlayer->setGender(token.sex); + // reserving bit for future usage + tempPlayer->setGender(token.sex & 1); character->data.mAttributes[EXP] = msg.readInt32(); character->data.mAttributes[MONEY] = msg.readInt32(); -- cgit v1.2.3-70-g09d2