diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-06-28 23:05:36 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2021-07-06 22:33:03 +0200 |
commit | 8a08b3d3b7721390760a37a82d654be291accaf4 (patch) | |
tree | da19bbefb16c0afa72ef89c7711d82720e8667aa | |
parent | Lighters: don't activate TNT when crouched (diff) | |
download | cuberite-8a08b3d3b7721390760a37a82d654be291accaf4.tar cuberite-8a08b3d3b7721390760a37a82d654be291accaf4.tar.gz cuberite-8a08b3d3b7721390760a37a82d654be291accaf4.tar.bz2 cuberite-8a08b3d3b7721390760a37a82d654be291accaf4.tar.lz cuberite-8a08b3d3b7721390760a37a82d654be291accaf4.tar.xz cuberite-8a08b3d3b7721390760a37a82d654be291accaf4.tar.zst cuberite-8a08b3d3b7721390760a37a82d654be291accaf4.zip |
-rw-r--r-- | src/ClientHandle.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index eac73e4ab..2e50c669b 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -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(); } |