From 1757e42c58b105722a8c49253d3fc63576a93502 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Tue, 23 Apr 2024 22:00:00 +0200 Subject: deduplicate branches --- src/net/tmwa/loginrecv.cpp | 19 +++++++------------ 1 file 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; } -- cgit v1.2.3-60-g2f50