Improve assert

Fix assert condition where iSocket and GetAcceptedSocketCount are both 0.
This commit is contained in:
Kawe Mazidjatari 2023-04-22 21:46:05 +02:00
parent 13fcdaa442
commit df81d52398
2 changed files with 3 additions and 2 deletions

View File

@ -548,7 +548,7 @@ void CRConServer::Disconnect(const int nIndex, const char* szReason) // NETMGR
szReason = "unknown reason";
}
DevMsg(eDLL_T::SERVER, "Connection to '%s' closed (%s)\n", netAdr.ToString(), szReason);
DevMsg(eDLL_T::SERVER, "Connection to '%s' lost (%s)\n", netAdr.ToString(), szReason);
m_nAuthConnections--;
}

View File

@ -92,7 +92,8 @@ bool CL_NetConConnect(CNetConBase* pBase, const char* pHostAdr, const int nHostP
CConnectedNetConsoleData* SH_GetNetConData(CNetConBase* pBase, const int iSocket)
{
const CSocketCreator* pCreator = pBase->GetSocketCreator();
Assert(iSocket >= 0 && iSocket < pCreator->GetAcceptedSocketCount());
Assert(iSocket >= 0 && (pCreator->GetAcceptedSocketCount() == 0
|| iSocket < pCreator->GetAcceptedSocketCount()));
if (!pCreator->GetAcceptedSocketCount())
{