summaryrefslogtreecommitdiff
path: root/src/gui/quitdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-01 20:04:35 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-01 20:04:35 +0300
commitb8cdabbd20690d57930dce9dda949fca21a6233a (patch)
treeddd3d0a3bb4d83206b92ede95b330430e803e26b /src/gui/quitdialog.cpp
parentab1f66527863c7fcce6c3ccedda0d5560dc063c7 (diff)
downloadmanaverse-b8cdabbd20690d57930dce9dda949fca21a6233a.tar.gz
manaverse-b8cdabbd20690d57930dce9dda949fca21a6233a.tar.bz2
manaverse-b8cdabbd20690d57930dce9dda949fca21a6233a.tar.xz
manaverse-b8cdabbd20690d57930dce9dda949fca21a6233a.zip
Eliminate asserts from most files.
Diffstat (limited to 'src/gui/quitdialog.cpp')
-rw-r--r--src/gui/quitdialog.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp
index f66872b5d..04f43fb88 100644
--- a/src/gui/quitdialog.cpp
+++ b/src/gui/quitdialog.cpp
@@ -41,23 +41,17 @@
#include "utils/gettext.h"
-#include <assert.h>
-
#include "debug.h"
QuitDialog::QuitDialog(QuitDialog** pointerToMe):
Window(_("Quit"), true, NULL), mMyPointer(pointerToMe)
{
-// int width = 200;
-// int height = 120;
-
mForceQuit = new RadioButton(_("Quit"), "quitdialog");
mLogoutQuit = new RadioButton(_("Quit"), "quitdialog");
mSwitchAccountServer = new RadioButton(_("Switch server"), "quitdialog");
mSwitchCharacter = new RadioButton(_("Switch character"), "quitdialog");
mOkButton = new Button(_("OK"), "ok", this);
mCancelButton = new Button(_("Cancel"), "cancel", this);
-// setContentSize(width, height);
addKeyListener(this);
@@ -149,10 +143,11 @@ void QuitDialog::action(const gcn::ActionEvent &event)
}
else if (mSwitchCharacter->isSelected())
{
- assert(Client::getState() == STATE_GAME);
-
- Net::getCharHandler()->switchCharacter();
- Client::closeDialogs();
+ if (Client::getState() == STATE_GAME)
+ {
+ Net::getCharHandler()->switchCharacter();
+ Client::closeDialogs();
+ }
}
}
scheduleDelete();