1
0

Remove outdated comment and redundant check

Refactoring made the comment no longer true.
The check isn't needed since no packets are sent, and Destroy does nothing, if m_HasSentDC.
This commit is contained in:
Tiger Wang 2021-06-28 22:05:36 +01:00
parent 3e8c945a09
commit 8a08b3d3b7

View File

@ -2440,15 +2440,11 @@ void cClientHandle::SendDetachEntity(const cEntity & a_Entity, const cEntity & a
void cClientHandle::SendDisconnect(const AString & a_Reason)
{
// Destruction (Destroy()) is called when the client disconnects, not when a disconnect packet (or anything else) is sent
// Otherwise, the cClientHandle instance is can be unexpectedly removed from the associated player - Core/#142
if (!m_HasSentDC)
{
LOGD("Sending a DC: \"%s\"", StripColorCodes(a_Reason).c_str());
m_Protocol.SendDisconnect(*this, a_Reason);
m_HasSentDC = true;
Destroy();
}
LOGD("Sending a DC: \"%s\"", StripColorCodes(a_Reason).c_str());
m_Protocol.SendDisconnect(*this, a_Reason);
m_HasSentDC = true;
Destroy();
}