summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tmwa/playerhandler.cpp37
1 files changed, 13 insertions, 24 deletions
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index ec0bd3d54..e7b5deb6c 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -273,38 +273,27 @@ void PlayerHandler::processOnlineList(Net::MessageIn &msg)
const char *buf = start;
- int addVal = 1;
- if (serverVersion >= 4)
- addVal = 3;
+ int addVal = 3;
while (buf - start + 1 < size
&& *(buf + static_cast<size_t>(addVal)))
{
- unsigned char status = 255;
- unsigned char ver = 0;
- unsigned char level = 0;
- if (serverVersion >= 4)
- {
- status = *buf;
- buf ++;
- level = *buf;
- buf ++;
- ver = *buf;
- }
+ unsigned char status = *buf;
+ buf ++;
+ unsigned char level = *buf;
+ buf ++;
+ unsigned char ver = *buf;
buf ++;
unsigned char gender = Gender::UNSPECIFIED;
- if (serverVersion >= 4)
+ if (config.getBoolValue("showgender"))
{
- if (config.getBoolValue("showgender"))
- {
- if (status & BeingFlag::GENDER_MALE)
- gender = Gender::MALE;
- else if (status & BeingFlag::GENDER_OTHER)
- gender = Gender::OTHER;
- else
- gender = Gender::FEMALE;
- }
+ if (status & BeingFlag::GENDER_MALE)
+ gender = Gender::MALE;
+ else if (status & BeingFlag::GENDER_OTHER)
+ gender = Gender::OTHER;
+ else
+ gender = Gender::FEMALE;
}
arr.push_back(new OnlinePlayer(static_cast<const char*>(buf),
status, level, gender, ver));