summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-22 00:38:26 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-22 00:38:26 +0300
commit972bbd781838c9150f87aad7c96c6bbd74a68e06 (patch)
treecc839b1ca698ec32c0dd3fc7c8d8e0ba09e8e923 /src
parentf6f2a8072c517ee47e77979db9dbb9ecb3430cb5 (diff)
downloadmv-972bbd781838c9150f87aad7c96c6bbd74a68e06.tar.gz
mv-972bbd781838c9150f87aad7c96c6bbd74a68e06.tar.bz2
mv-972bbd781838c9150f87aad7c96c6bbd74a68e06.tar.xz
mv-972bbd781838c9150f87aad7c96c6bbd74a68e06.zip
Fix change password issue with empty players list.
Diffstat (limited to 'src')
-rw-r--r--src/gui/charselectdialog.cpp4
-rw-r--r--src/gui/logindialog.cpp3
-rw-r--r--src/net/eathena/charserverhandler.cpp3
-rw-r--r--src/net/tmwa/charserverhandler.cpp3
4 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp
index ffa88cb75..bc2c42dc7 100644
--- a/src/gui/charselectdialog.cpp
+++ b/src/gui/charselectdialog.cpp
@@ -319,7 +319,6 @@ CharSelectDialog::CharSelectDialog(LoginData *const data):
CharSelectDialog::~CharSelectDialog()
{
- Net::getCharHandler()->clear();
}
void CharSelectDialog::action(const gcn::ActionEvent &event)
@@ -351,6 +350,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
if (eventId == "use" && mCharacterEntries[selected]->getCharacter())
{
attemptCharacterSelect(selected);
+// Net::getCharHandler()->clear();
return;
}
else if (eventId == "new" &&
@@ -371,6 +371,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
}
if (eventId == "switch")
{
+ Net::getCharHandler()->clear();
close();
}
else if (eventId == "change_password")
@@ -383,6 +384,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
}
else if (eventId == "unregister")
{
+ Net::getCharHandler()->clear();
Client::setState(STATE_UNREGISTER);
}
else if (eventId == "try delete character")
diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp
index b0015bf46..5767390c7 100644
--- a/src/gui/logindialog.cpp
+++ b/src/gui/logindialog.cpp
@@ -38,6 +38,7 @@
#include "gui/widgets/layout.h"
#include "gui/widgets/passwordfield.h"
+#include "net/charhandler.h"
#include "net/logindata.h"
#include "net/loginhandler.h"
#include "net/net.h"
@@ -154,6 +155,8 @@ LoginDialog::LoginDialog(LoginData *const data, std::string serverName,
{
setCloseButton(true);
+ Net::getCharHandler()->clear();
+
Label *const serverLabel1 = new Label(this, _("Server:"));
Label *const serverLabel2 = new Label(this, serverName);
serverLabel2->adjustSize();
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 2bb7e8890..474874483 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -127,8 +127,7 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
mSelectedCharacter->dummy = nullptr;
- delete_all(mCharacters);
- mCharacters.clear();
+ Net::getCharHandler()->clear();
updateCharSelectDialog();
if (mNetwork)
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 7f84faaca..d922f0852 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -128,8 +128,7 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
mSelectedCharacter->dummy = nullptr;
- delete_all(mCharacters);
- mCharacters.clear();
+ Net::getCharHandler()->clear();
updateCharSelectDialog();
if (mNetwork)