summaryrefslogtreecommitdiff
path: root/src/net/eathena/network.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/network.cpp')
-rw-r--r--src/net/eathena/network.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 96675002d..78ff3377e 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -98,15 +98,8 @@ void Network::dispatchMessages()
SDL_mutexP(mMutexIn);
const unsigned int msgId = readWord(0);
int len = -1;
- if (msgId == SMSG_UPDATE_HOST2)
- {
- len = -1;
- }
- else
- {
- if (msgId < packet_lengths_size)
- len = packet_lengths[msgId];
- }
+ if (msgId < packet_lengths_size)
+ len = packet_lengths[msgId];
if (len == -1)
len = readWord(2);
@@ -147,17 +140,10 @@ bool Network::messageReady()
if (mInSize >= 2)
{
const int msgId = readWord(0);
- if (msgId == SMSG_UPDATE_HOST2)
- {
- len = -1;
- }
- else
+ if (msgId >= 0 && static_cast<unsigned int>(msgId)
+ < packet_lengths_size)
{
- if (msgId >= 0 && static_cast<unsigned int>(msgId)
- < packet_lengths_size)
- {
- len = packet_lengths[msgId];
- }
+ len = packet_lengths[msgId];
}
if (len == -1 && mInSize > 4)