From b8cdabbd20690d57930dce9dda949fca21a6233a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 1 Sep 2011 20:04:35 +0300 Subject: Eliminate asserts from most files. --- src/gui/quitdialog.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/gui/quitdialog.cpp') 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 - #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(); -- cgit v1.2.3-70-g09d2