summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-04-24 18:09:44 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-04-24 18:09:44 +0200
commit00e7b65d8785bd403f5df8e40f233f1a31d46577 (patch)
tree50dc12fed52570a98fa06919629866ece6709e69
parentMerge pull request #3163 from cuberite/revert-3153-chunkLayer (diff)
downloadcuberite-00e7b65d8785bd403f5df8e40f233f1a31d46577.tar
cuberite-00e7b65d8785bd403f5df8e40f233f1a31d46577.tar.gz
cuberite-00e7b65d8785bd403f5df8e40f233f1a31d46577.tar.bz2
cuberite-00e7b65d8785bd403f5df8e40f233f1a31d46577.tar.lz
cuberite-00e7b65d8785bd403f5df8e40f233f1a31d46577.tar.xz
cuberite-00e7b65d8785bd403f5df8e40f233f1a31d46577.tar.zst
cuberite-00e7b65d8785bd403f5df8e40f233f1a31d46577.zip
-rw-r--r--src/ClientHandle.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 10fc66b21..8a45b0d6d 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -124,7 +124,6 @@ cClientHandle::~cClientHandle()
{
RemoveFromAllChunks();
m_Player->GetWorld()->RemoveClientFromChunkSender(this);
- m_Player->SetIsTicking(false);
if (!m_Username.empty())
{
// Send the Offline PlayerList packet:
@@ -174,6 +173,8 @@ void cClientHandle::Destroy(void)
cWorld * World = m_Player->GetWorld();
if (World != nullptr)
{
+ m_Player->StopEveryoneFromTargetingMe();
+ m_Player->SetIsTicking(false);
World->RemovePlayer(m_Player, true);
}
m_Player->RemoveClientHandle();
@@ -3084,7 +3085,7 @@ void cClientHandle::SocketClosed(void)
}
if (m_Player != nullptr)
{
- m_Player->GetWorld()->ScheduleTask(1, [this](cWorld & World)
+ m_Player->GetWorld()->QueueTask([this](cWorld & World)
{
UNUSED(World);
Destroy();