Only clear the error string if none is given

This commit is contained in:
heinrich5991 2015-09-11 11:08:35 +01:00
parent 2d404bdfa0
commit 19e9f4e2fb

View file

@ -206,9 +206,12 @@ void CNetConnection::Disconnect(const char *pReason)
else
SendControl(NET_CTRLMSG_CLOSE, 0, 0);
m_ErrorString[0] = 0;
if(pReason && pReason != m_ErrorString)
str_copy(m_ErrorString, pReason, sizeof(m_ErrorString));
if(pReason != m_ErrorString)
{
m_ErrorString[0] = 0;
if(pReason)
str_copy(m_ErrorString, pReason, sizeof(m_ErrorString));
}
}
Reset();