mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Do not unpack map data packet if no map download is progress
There is no need to unpack map data packets if the client receives any without expecting them.
This commit is contained in:
parent
b264570218
commit
9ffa9d8e0a
|
@ -1468,12 +1468,17 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
|
||||||
}
|
}
|
||||||
else if(Conn == CONN_MAIN && Msg == NETMSG_MAP_DATA)
|
else if(Conn == CONN_MAIN && Msg == NETMSG_MAP_DATA)
|
||||||
{
|
{
|
||||||
|
if(!m_MapdownloadFileTemp)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int Last = Unpacker.GetInt();
|
int Last = Unpacker.GetInt();
|
||||||
int MapCRC = Unpacker.GetInt();
|
int MapCRC = Unpacker.GetInt();
|
||||||
int Chunk = Unpacker.GetInt();
|
int Chunk = Unpacker.GetInt();
|
||||||
int Size = Unpacker.GetInt();
|
int Size = Unpacker.GetInt();
|
||||||
const unsigned char *pData = Unpacker.GetRaw(Size);
|
const unsigned char *pData = Unpacker.GetRaw(Size);
|
||||||
if(Unpacker.Error() || Size <= 0 || MapCRC != m_MapdownloadCrc || Chunk != m_MapdownloadChunk || !m_MapdownloadFileTemp)
|
if(Unpacker.Error() || Size <= 0 || MapCRC != m_MapdownloadCrc || Chunk != m_MapdownloadChunk)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue