summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-21 22:44:29 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-21 22:45:15 +0300
commit42f47e483da19079a937c4801ca94bd62d8dc970 (patch)
tree56dc96737e01e04d54357ce7118de3a1f000c516 /src/net
parent2d8b9246c8003f1d32ba396bc19cc11bc5a595b2 (diff)
downloadmv-42f47e483da19079a937c4801ca94bd62d8dc970.tar.gz
mv-42f47e483da19079a937c4801ca94bd62d8dc970.tar.bz2
mv-42f47e483da19079a937c4801ca94bd62d8dc970.tar.xz
mv-42f47e483da19079a937c4801ca94bd62d8dc970.zip
Remove useless else.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/equipbackend.h3
-rw-r--r--src/net/eathena/partyhandler.cpp5
-rw-r--r--src/net/ipc.cpp6
-rw-r--r--src/net/packetlimiter.cpp14
-rw-r--r--src/net/tmwa/guildmanager.cpp57
5 files changed, 34 insertions, 51 deletions
diff --git a/src/net/ea/equipbackend.h b/src/net/ea/equipbackend.h
index 49d2b0377..15aeb93fb 100644
--- a/src/net/ea/equipbackend.h
+++ b/src/net/ea/equipbackend.h
@@ -53,8 +53,7 @@ class EquipBackend final : public Equipment::Backend
const Inventory *const inv = PlayerInfo::getInventory();
if (inv != nullptr)
return inv->getItem(invyIndex);
- else
- return nullptr;
+ return nullptr;
}
void clear() override final
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index bc3bcfb83..07482dce7 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -172,11 +172,6 @@ void PartyHandler::setShareItems(const PartyShareT share) const
"share exp");
outMsg.writeInt16(CAST_S16(share), "share items");
}
- else
- {
-// outMsg.writeInt32(CAST_S16(Ea::PartyRecv::mShareExp),
-// "share exp");
- }
}
void PartyHandler::changeLeader(const std::string &name) const
diff --git a/src/net/ipc.cpp b/src/net/ipc.cpp
index 14dd27504..b3fd3da9d 100644
--- a/src/net/ipc.cpp
+++ b/src/net/ipc.cpp
@@ -181,10 +181,8 @@ void IPC::start()
logger->log(" -> Port %d selected", f);
return;
}
- else
- {
- port ++;
- }
+
+ port ++;
}
delete2(ipc);
}
diff --git a/src/net/packetlimiter.cpp b/src/net/packetlimiter.cpp
index 8dc8211b2..ba87badc7 100644
--- a/src/net/packetlimiter.cpp
+++ b/src/net/packetlimiter.cpp
@@ -275,11 +275,8 @@ bool PacketLimiter::checkPackets(const PacketTypeT type)
{
return false;
}
- else
- {
-// instance()->mPacketLimits[type].cnt ++;
- return true;
- }
+// instance()->mPacketLimits[type].cnt ++;
+ return true;
}
// instance()->mPacketLimits[type].lastTime = time;
// instance()->mPacketLimits[type].cnt = 1;
@@ -317,11 +314,8 @@ bool PacketLimiter::limitPackets(const PacketTypeT type)
{
return false;
}
- else
- {
- pack.cnt ++;
- return true;
- }
+ pack.cnt ++;
+ return true;
}
pack.lastTime = time;
pack.cnt = 1;
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;
}