diff options
-rw-r--r-- | src/net/tmwa/loginrecv.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/net/tmwa/loginrecv.cpp b/src/net/tmwa/loginrecv.cpp index 25341889a..aa9b89fb9 100644 --- a/src/net/tmwa/loginrecv.cpp +++ b/src/net/tmwa/loginrecv.cpp @@ -62,28 +62,23 @@ void LoginRecv::processServerVersion(Net::MessageIn &msg) const uint8_t b2 = msg.readUInt8("b2"); const uint8_t b3 = msg.readUInt8("b3"); msg.readUInt8("b4"); + const unsigned int options = msg.readInt32("options"); + + Ea::LoginRecv::mRegistrationEnabled = + ((options & FLAG_REGISTRATION) != 0U); + + serverVersion = 0; + if (b1 == 255) { // old TMWA - const unsigned int options = msg.readInt32("options"); - Ea::LoginRecv::mRegistrationEnabled = - ((options & FLAG_REGISTRATION) != 0U); - serverVersion = 0; tmwServerVersion = 0; } else if (b1 >= 0x0d) { // new TMWA - const unsigned int options = msg.readInt32("options"); - Ea::LoginRecv::mRegistrationEnabled = - ((options & FLAG_REGISTRATION) != 0U); - serverVersion = 0; tmwServerVersion = (b1 << 16) | (b2 << 8) | b3; } else { // eAthena - const unsigned int options = msg.readInt32("options"); - Ea::LoginRecv::mRegistrationEnabled = - ((options & FLAG_REGISTRATION) != 0U); - serverVersion = 0; tmwServerVersion = 0; } |