summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/loginhandler.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
3 files changed, 11 insertions, 1 deletions
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index f60a7d934..35321b1b8 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -25,6 +25,9 @@
#include "client.h"
#include "logger.h"
+#include "net/net.h"
+#include "net/serverfeatures.h"
+
#include "net/tmwa/messageout.h"
#include "net/tmwa/network.h"
#include "net/tmwa/protocol.h"
@@ -264,7 +267,7 @@ void LoginHandler::processUpdateHost2(Net::MessageIn &msg) const
int LoginHandler::supportedOptionalActions() const
{
- return serverVersion >= 7
+ return Net::getServerFeatures()->haveEmailOnRegister()
? Net::RegistrationOptions::SetEmailOnRegister
| Net::RegistrationOptions::SetGenderOnRegister
: Net::RegistrationOptions::SetGenderOnRegister;
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index aaba467ac..73791e6c8 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -119,4 +119,9 @@ bool ServerFeatures::haveMonsterAttackRange() const
return serverVersion > 0;
}
+bool ServerFeatures::haveEmailOnRegister() const
+{
+ return serverVersion >= 7;
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index c5b3fddaa..6c8776e8e 100644
--- a/src/net/tmwa/serverfeatures.h
+++ b/src/net/tmwa/serverfeatures.h
@@ -67,6 +67,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveOtherGender() const override final;
bool haveMonsterAttackRange() const override final;
+
+ bool haveEmailOnRegister() const override final;
};
} // namespace TmwAthena