From 112d2ad1904051160822d1845d1418cca889c0d5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Mar 2012 03:56:02 +0300 Subject: Add support for other gender. Fix per gender and race items separation. --- src/net/tmwa/beinghandler.cpp | 3 +-- src/net/tmwa/charserverhandler.cpp | 2 +- src/net/tmwa/gamehandler.cpp | 2 +- src/net/tmwa/playerhandler.cpp | 4 +++- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 8d279fc32..5eb02d299 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -515,8 +515,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, int msgType) dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3 msg.readInt8(); // karma // reserving bit for future usage - dstBeing->setGender(((msg.readInt8() & 1) == 0) - ? GENDER_FEMALE : GENDER_MALE); + dstBeing->setGender(Being::intToGender(msg.readInt8() & 3)); // 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 1bee91144..6202070bb 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -333,7 +333,7 @@ void CharServerHandler::connect() outMsg.writeInt16(CLIENT_PROTOCOL_VERSION); else outMsg.writeInt16(CLIENT_TMW_PROTOCOL_VERSION); - outMsg.writeInt8((token.sex == GENDER_MALE) ? 1 : 0); + outMsg.writeInt8(Being::genderToInt(token.sex)); // We get 4 useless bytes before the real answer comes in (what are these?) mNetwork->skip(4); diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 5acf9ae6c..2496898d1 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -125,7 +125,7 @@ void GameHandler::connect() outMsg.writeInt32(mCharID); outMsg.writeInt32(token.session_ID1); outMsg.writeInt32(token.session_ID2); - outMsg.writeInt8((token.sex == GENDER_MALE) ? 1 : 0); + outMsg.writeInt8(Being::genderToInt(token.sex)); /* if (player_node) diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index a63af770a..eb9dac6f0 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -259,8 +259,10 @@ void PlayerHandler::processOnlineList(Net::MessageIn &msg) { if (config.getBoolValue("showgender")) { - if (status & Being::FLAG_GENDER) + if (status & Being::FLAG_GENDER_MALE) gender = GENDER_MALE; + else if (status & Being::FLAG_GENDER_OTHER) + gender = GENDER_OTHER; else gender = GENDER_FEMALE; } -- cgit v1.2.3-70-g09d2