From e6acf6e2f17b4177f3f8292f52d83b46822ab9c5 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sat, 2 Oct 2010 15:59:46 +0200 Subject: Avoiding the creation of a party or guild without a name If no name is given, then the player obviously didn't want to create it. Now the empty input is handled just the same way as in the invite dialog. Trivial fix. --- src/gui/socialwindow.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/gui/socialwindow.cpp') diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index 290fd557..7944e210 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -500,12 +500,13 @@ void SocialWindow::action(const gcn::ActionEvent &event) { localChatTab->chatLog(_("Creating guild failed, please choose a " "shorter name."), BY_SERVER); - return; } - - Net::getGuildHandler()->create(name); - localChatTab->chatLog(strprintf(_("Creating guild called %s."), - name.c_str()), BY_SERVER); + else if (!name.empty()) + { + Net::getGuildHandler()->create(name); + localChatTab->chatLog(strprintf(_("Creating guild called %s."), + name.c_str()), BY_SERVER); + } mGuildCreateDialog = NULL; } @@ -521,12 +522,13 @@ void SocialWindow::action(const gcn::ActionEvent &event) { localChatTab->chatLog(_("Creating party failed, please choose a " "shorter name."), BY_SERVER); - return; } - - Net::getPartyHandler()->create(name); - localChatTab->chatLog(strprintf(_("Creating party called %s."), - name.c_str()), BY_SERVER); + else if (!name.empty()) + { + Net::getPartyHandler()->create(name); + localChatTab->chatLog(strprintf(_("Creating party called %s."), + name.c_str()), BY_SERVER); + } mPartyCreateDialog = NULL; } -- cgit v1.2.3-70-g09d2