From f521cbeb31e90e4c5c25edb6686544530ddbaf99 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 16 Dec 2013 10:41:35 +0100 Subject: Fixed cClientHandle::Tick() being called from two threads. When the player was initialized, the Tick() function continued to stream chunk, while the cWorld called Tick() from its tick thread. Final fix for #187. --- src/Entities/Player.cpp | 22 ---------------------- src/Entities/Player.h | 2 -- 2 files changed, 24 deletions(-) (limited to 'src/Entities') diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 5165c2f8a..7e7d77433 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -137,28 +137,6 @@ cPlayer::~cPlayer(void) -bool cPlayer::Initialize(cWorld * a_World) -{ - ASSERT(a_World != NULL); - - if (super::Initialize(a_World)) - { - // Remove the client handle from the server, it will be ticked from this object from now on - if (m_ClientHandle != NULL) - { - cRoot::Get()->GetServer()->ClientMovedToWorld(m_ClientHandle); - } - - GetWorld()->AddPlayer(this); - return true; - } - return false; -} - - - - - void cPlayer::Destroyed() { CloseWindow(false); diff --git a/src/Entities/Player.h b/src/Entities/Player.h index a09f7f489..59e941040 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -41,8 +41,6 @@ public: cPlayer(cClientHandle * a_Client, const AString & a_PlayerName); virtual ~cPlayer(); - virtual bool Initialize(cWorld * a_World) override; - virtual void SpawnOn(cClientHandle & a_Client) override; virtual void Tick(float a_Dt, cChunk & a_Chunk) override; -- cgit v1.2.3