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,10 +206,13 @@ void CNetConnection::Disconnect(const char *pReason)
else else
SendControl(NET_CTRLMSG_CLOSE, 0, 0); SendControl(NET_CTRLMSG_CLOSE, 0, 0);
if(pReason != m_ErrorString)
{
m_ErrorString[0] = 0; m_ErrorString[0] = 0;
if(pReason && pReason != m_ErrorString) if(pReason)
str_copy(m_ErrorString, pReason, sizeof(m_ErrorString)); str_copy(m_ErrorString, pReason, sizeof(m_ErrorString));
} }
}
Reset(); Reset();
} }