diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-21 22:44:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-21 22:45:15 +0300 |
commit | 42f47e483da19079a937c4801ca94bd62d8dc970 (patch) | |
tree | 56dc96737e01e04d54357ce7118de3a1f000c516 /src/net/tmwa/guildmanager.cpp | |
parent | 2d8b9246c8003f1d32ba396bc19cc11bc5a595b2 (diff) | |
download | mv-42f47e483da19079a937c4801ca94bd62d8dc970.tar.gz mv-42f47e483da19079a937c4801ca94bd62d8dc970.tar.bz2 mv-42f47e483da19079a937c4801ca94bd62d8dc970.tar.xz mv-42f47e483da19079a937c4801ca94bd62d8dc970.zip |
Remove useless else.
Diffstat (limited to 'src/net/tmwa/guildmanager.cpp')
-rw-r--r-- | src/net/tmwa/guildmanager.cpp | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/src/net/tmwa/guildmanager.cpp b/src/net/tmwa/guildmanager.cpp index 168f4cdea..5484f1b51 100644 --- a/src/net/tmwa/guildmanager.cpp +++ b/src/net/tmwa/guildmanager.cpp @@ -428,45 +428,42 @@ bool GuildManager::process(std::string msg) guild->removeMember(msg); return true; } - else if (msg == "You have been removed from the Guild" - || msg == "You have left the Guild") + else if (msg == "You have been removed from the Guild" || + msg == "You have left the Guild") { return afterRemove(); } - else + Guild *const guild = createGuild(); + if (guild == nullptr) + return false; + if (mTab == nullptr) { - Guild *const guild = createGuild(); - if (guild == nullptr) - return false; - if (mTab == nullptr) - { - createTab(guild); - } - if (mTab != nullptr) + createTab(guild); + } + if (mTab != nullptr) + { + const size_t pos = msg.find(": ", 0); + if (pos != std::string::npos) { - const size_t pos = msg.find(": ", 0); - if (pos != std::string::npos) - { - const std::string sender_name = msg.substr(0, pos); - if (guild->getMember(sender_name) == nullptr) - { - mTab->chatLog(msg, ChatMsgType::BY_SERVER); - return true; - } - - msg.erase(0, pos + 2); - if (msg.size() > 3 && msg[0] == '#' && msg[1] == '#') - msg.erase(0, 3); - - trim(msg); - mTab->chatLog(sender_name, msg); - } - else + const std::string sender_name = msg.substr(0, pos); + if (guild->getMember(sender_name) == nullptr) { mTab->chatLog(msg, ChatMsgType::BY_SERVER); + return true; } - return true; + + msg.erase(0, pos + 2); + if (msg.size() > 3 && msg[0] == '#' && msg[1] == '#') + msg.erase(0, 3); + + trim(msg); + mTab->chatLog(sender_name, msg); + } + else + { + mTab->chatLog(msg, ChatMsgType::BY_SERVER); } + return true; } return false; } |