summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-09 20:14:21 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-09 20:14:21 +0300
commitecef66ec4e58ac44fe3d144c5157e799173cef91 (patch)
tree01ff0dda74e8b227233e11846c4b458e9623ee85 /src
parent13ec103b3e76c3750993905413a8ac72383176c3 (diff)
downloadmanaplus-ecef66ec4e58ac44fe3d144c5157e799173cef91.tar.gz
manaplus-ecef66ec4e58ac44fe3d144c5157e799173cef91.tar.bz2
manaplus-ecef66ec4e58ac44fe3d144c5157e799173cef91.tar.xz
manaplus-ecef66ec4e58ac44fe3d144c5157e799173cef91.zip
Add per char gender into tmwa.
Diffstat (limited to 'src')
-rw-r--r--src/net/tmwa/charserverrecv.cpp8
-rw-r--r--src/net/tmwa/serverfeatures.cpp4
2 files changed, 8 insertions, 4 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)
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 78d06c523..f3329a66e 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -116,7 +116,7 @@ bool ServerFeatures::haveAccountOtherGender() const
bool ServerFeatures::haveCharOtherGender() const
{
- return false;
+ return tmwServerVersion > 0x0f0b17;
}
bool ServerFeatures::haveMonsterAttackRange() const
@@ -181,7 +181,7 @@ bool ServerFeatures::haveNpcWhispers() const
bool ServerFeatures::haveCreateCharGender() const
{
- return false;
+ return tmwServerVersion > 0x0f0b17;
}
bool ServerFeatures::haveAttackDirections() const