summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-02 19:12:35 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-02 19:12:35 +0200
commit1bb4d7941267ee55cdf7f35fa6a0055521115960 (patch)
tree38b2faa2d824bca6da9ec88c2c0c0d9bbe81f6df /src/ClientHandle.cpp
parentAdded name tag (diff)
downloadcuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.gz
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.bz2
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.lz
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.xz
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.zst
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index f9c6a664c..e97c126a1 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -124,13 +124,11 @@ cClientHandle::~cClientHandle()
if (m_Player != NULL)
{
cWorld * World = m_Player->GetWorld();
- if (!m_Username.empty() && (World != NULL))
- {
- // Send the Offline PlayerList packet:
- World->BroadcastPlayerListItem(*m_Player, false, this);
- }
if (World != NULL)
{
+ // Send the Offline PlayerList packet:
+ World->BroadcastPlayerListItem(m_Player->GetTabListName(), false, 0, 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();
}
@@ -2371,9 +2369,9 @@ void cClientHandle::SendPlayerAbilities()
-void cClientHandle::SendPlayerListItem(const cPlayer & a_Player, bool a_IsOnline)
+void cClientHandle::SendPlayerListItem(const AString & a_PlayerName, bool a_IsOnline, short a_Ping)
{
- m_Protocol->SendPlayerListItem(a_Player, a_IsOnline);
+ m_Protocol->SendPlayerListItem(a_PlayerName, a_IsOnline, a_Ping);
}