Improve readability by renaming variable and changing condition

Rename variable `i` to `Conn`. Check for `CONN_MAIN` and `CONN_DUMMY` explicitly instead of using numeric index.
This commit is contained in:
Robert Müller 2024-03-27 22:29:42 +01:00
parent 9e5369bc9d
commit 87f9ccdb22

View file

@ -2284,20 +2284,19 @@ void CClient::PumpNetwork()
// process packets // process packets
CNetChunk Packet; CNetChunk Packet;
for(int i = 0; i < NUM_CONNS; i++) for(int Conn = 0; Conn < NUM_CONNS; Conn++)
{ {
while(m_aNetClient[i].Recv(&Packet)) while(m_aNetClient[Conn].Recv(&Packet))
{ {
if(Packet.m_ClientId == -1) if(Packet.m_ClientId == -1)
{ {
ProcessConnlessPacket(&Packet); ProcessConnlessPacket(&Packet);
continue; continue;
} }
if(i > 1) if(Conn == CONN_MAIN || Conn == CONN_DUMMY)
{ {
continue; ProcessServerPacket(&Packet, Conn, g_Config.m_ClDummy ^ Conn);
} }
ProcessServerPacket(&Packet, i, g_Config.m_ClDummy ^ i);
} }
} }
} }