summaryrefslogtreecommitdiff
path: root/src/net/logindata.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-12-28 00:56:53 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-12-29 07:38:39 +0100
commit411b54e993ea997e18be18fadd26ceab00c00fa3 (patch)
tree6f95ec02b917e391de95ae8e496e71a314e96b37 /src/net/logindata.h
parent780bcbc2ea75603f2eef7369a6f7b5ddfc5888b5 (diff)
downloadmana-411b54e993ea997e18be18fadd26ceab00c00fa3.tar.gz
mana-411b54e993ea997e18be18fadd26ceab00c00fa3.tar.bz2
mana-411b54e993ea997e18be18fadd26ceab00c00fa3.tar.xz
mana-411b54e993ea997e18be18fadd26ceab00c00fa3.zip
Fixed potential flaw for the number of characters slots on tAthena.
Was happening when logging to the dev manaserv server and then to TMW-eA. The client is still crashing after selecting the characters after relogging but that's not introduced with this patch anyway. Reviewed-by: Crush.
Diffstat (limited to 'src/net/logindata.h')
-rw-r--r--src/net/logindata.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/net/logindata.h b/src/net/logindata.h
index 7f729559..4a1c1a9f 100644
--- a/src/net/logindata.h
+++ b/src/net/logindata.h
@@ -31,12 +31,11 @@ class LoginData
public:
/**
* Constructor
- *
- * Initialize character slots to 3 for TmwAthena compatibility
*/
- LoginData():
- characterSlots(3)
- {}
+ LoginData()
+ {
+ resetCharacterSlots();
+ }
std::string username;
std::string password;
@@ -53,6 +52,14 @@ public:
unsigned short characterSlots; /**< The number of character slots */
+ /**
+ * Initialize character slots to 3 for TmwAthena compatibility
+ */
+ void resetCharacterSlots()
+ {
+ characterSlots = 3; // Default value, used for TmwAthena.
+ }
+
void clear()
{
username.clear();
@@ -62,7 +69,7 @@ public:
email.clear();
captchaResponse.clear();
gender = GENDER_UNSPECIFIED;
- characterSlots = 3; // Default value, used for TmwAthena.
+ resetCharacterSlots();
}
};