summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorFranz Reiter <franzi.moos@googlemail.com>2014-09-23 15:54:07 +0200
committerFranz Reiter <franzi.moos@googlemail.com>2014-09-23 15:54:07 +0200
commit33f8091d5f550a91b1fbe24f07a397aa5a336093 (patch)
tree4fe1be83dd4212e010fed749cd444c4deecc64e6 /src/ClientHandle.cpp
parentQtBiomeVisualiser: Fixed confusion about Globals.h. (diff)
parentFixed SQLiteCpp downgrade (diff)
downloadcuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.gz
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.bz2
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.lz
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.xz
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.zst
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 43a4161e4..1e2f4ffad 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -124,13 +124,14 @@ cClientHandle::~cClientHandle()
if (m_Player != NULL)
{
cWorld * World = m_Player->GetWorld();
- if (!m_Username.empty() && (World != NULL))
- {
- // Send the Offline PlayerList packet:
- World->BroadcastPlayerListRemovePlayer(*m_Player, this);
- }
if (World != NULL)
{
+ if (!m_Username.empty())
+ {
+ // Send the Offline PlayerList packet:
+ World->BroadcastPlayerListRemovePlayer(*m_Player, this);
+ }
+
World->RemovePlayer(m_Player, true); // Must be called before cPlayer::Destroy() as otherwise cChunk tries to delete the player, and then we do it again
m_Player->Destroy();
}