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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user