diff --git a/r5dev/public/bansystem.cpp b/r5dev/public/bansystem.cpp index 5c82c22f..c7c64034 100644 --- a/r5dev/public/bansystem.cpp +++ b/r5dev/public/bansystem.cpp @@ -170,18 +170,16 @@ void CBanSystem::BanListCheck(void) { for (int c = 0; c < MAX_PLAYERS; c++) // Loop through all possible client instances. { - CClient* pClient = g_pClient->GetClient(c); - CNetChan* pNetChan = pClient->GetNetChan(); - - if (!pClient || !pNetChan) - { + CClient* pClient = g_pClient->GetClient(i); + if (!pClient) + continue; + + CNetChan* pNetChan = pClient->GetNetChan(); + if (!pNetChan) continue; - } if (pClient->GetOriginID() != m_vRefuseList[i].second) - { continue; - } string svIpAddress = pNetChan->GetAddress(); diff --git a/r5dev/vstdlib/callback.cpp b/r5dev/vstdlib/callback.cpp index 07e8cb60..afbd22f2 100644 --- a/r5dev/vstdlib/callback.cpp +++ b/r5dev/vstdlib/callback.cpp @@ -80,11 +80,12 @@ void Host_Kick_f(const CCommand& args) for (int i = 0; i < MAX_PLAYERS; i++) { CClient* pClient = g_pClient->GetClient(i); - CNetChan* pNetChan = pClient->GetNetChan(); - if (!pClient || !pNetChan) - { + if (!pClient) + continue; + + CNetChan* pNetChan = pClient->GetNetChan(); + if (!pNetChan) continue; - } string svClientName = pNetChan->GetName(); // Get full name. @@ -120,12 +121,12 @@ void Host_KickID_f(const CCommand& args) for (int i = 0; i < MAX_PLAYERS; i++) { CClient* pClient = g_pClient->GetClient(i); - CNetChan* pNetChan = pClient->GetNetChan(); - - if (!pClient || !pNetChan) - { + if (!pClient) + continue; + + CNetChan* pNetChan = pClient->GetNetChan(); + if (!pNetChan) continue; - } string svIpAddress = pNetChan->GetAddress(); // If this stays null they modified the packet somehow. @@ -184,12 +185,12 @@ void Host_Ban_f(const CCommand& args) for (int i = 0; i < MAX_PLAYERS; i++) { CClient* pClient = g_pClient->GetClient(i); - CNetChan* pNetChan = pClient->GetNetChan(); - - if (!pClient || !pNetChan) - { + if (!pClient) + continue; + + CNetChan* pNetChan = pClient->GetNetChan(); + if (!pNetChan) continue; - } string svClientName = pNetChan->GetName(); // Get full name. @@ -229,12 +230,12 @@ void Host_BanID_f(const CCommand& args) for (int i = 0; i < MAX_PLAYERS; i++) { CClient* pClient = g_pClient->GetClient(i); - CNetChan* pNetChan = pClient->GetNetChan(); - - if (!pClient || !pNetChan) - { + if (!pClient) + continue; + + CNetChan* pNetChan = pClient->GetNetChan(); + if (!pNetChan) continue; - } string svIpAddress = pNetChan->GetAddress(); // If this stays empty they modified the packet somehow.