Merge pull request #334 from heinrich5991/pr_error_string

Only clear the error string if none is given
This commit is contained in:
Tim Schumacher 2015-10-21 02:56:06 +02:00
commit 7bf36ac174

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();