From a879778968c5f9eaae97026b42046371d382b489 Mon Sep 17 00:00:00 2001 From: mathiascode <8754153+mathiascode@users.noreply.github.com> Date: Mon, 2 Apr 2018 20:39:54 +0300 Subject: Broadcast playerlist removal in every world (#4201) --- src/ClientHandle.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 2d30224ad..3afd4cc83 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -127,13 +127,11 @@ cClientHandle::~cClientHandle() { RemoveFromAllChunks(); m_Player->GetWorld()->RemoveClientFromChunkSender(this); - if (!m_Username.empty()) - { - // Send the Offline PlayerList packet: - World->BroadcastPlayerListRemovePlayer(*m_Player, this); - } m_Player->DestroyNoScheduling(true); } + // Send the Offline PlayerList packet: + cRoot::Get()->BroadcastPlayerListsRemovePlayer(*m_Player); + m_PlayerPtr.reset(); m_Player = nullptr; } -- cgit v1.2.3