summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-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