summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-06-28 23:05:36 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-07-06 22:33:03 +0200
commit8a08b3d3b7721390760a37a82d654be291accaf4 (patch)
treeda19bbefb16c0afa72ef89c7711d82720e8667aa
parentLighters: don't activate TNT when crouched (diff)
downloadcuberite-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.cpp14
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();
}