From 8bff3e5af220070ecc789ef551c0b8428b8953ef Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 31 May 2014 22:28:51 +0100 Subject: Implemented end and nether portals --- src/ClientHandle.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 9b03bead9..8a5c81e70 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -125,7 +125,6 @@ cClientHandle::~cClientHandle() } if (World != NULL) { - World->RemovePlayer(m_Player); m_Player->Destroy(); } delete m_Player; @@ -1754,7 +1753,7 @@ void cClientHandle::MoveToWorld(cWorld & a_World, bool a_SendRespawnPacket) if (a_SendRespawnPacket) { - SendRespawn(); + SendRespawn(a_World); } cWorld * World = m_Player->GetWorld(); @@ -2373,9 +2372,9 @@ void cClientHandle::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effec -void cClientHandle::SendRespawn(void) +void cClientHandle::SendRespawn(const cWorld & a_World) { - m_Protocol->SendRespawn(); + m_Protocol->SendRespawn(a_World); } -- cgit v1.2.3 From 29567c56107c86b70da130f995564beb2eaf424c Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 12 Jun 2014 15:21:07 +0100 Subject: Portals animate and delay correctly --- src/ClientHandle.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 256dad7da..84f096d67 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1766,8 +1766,7 @@ void cClientHandle::RemoveFromWorld(void) m_Protocol->SendUnloadChunk(itr->m_ChunkX, itr->m_ChunkZ); } // for itr - Chunks[] - // StreamChunks() called in cPlayer::MoveToWorld() after new world has been set - // Meanwhile here, we set last streamed values to bogus ones so everything is resent + // Here, we set last streamed values to bogus ones so everything is resent m_LastStreamedChunkX = 0x7fffffff; m_LastStreamedChunkZ = 0x7fffffff; m_HasSentPlayerChunk = false; @@ -2367,9 +2366,9 @@ void cClientHandle::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effec -void cClientHandle::SendRespawn(const cWorld & a_World) +void cClientHandle::SendRespawn(eDimension a_Dimension) { - m_Protocol->SendRespawn(a_World); + m_Protocol->SendRespawn(a_Dimension); } -- cgit v1.2.3 From 719551c31f5ed0d3cbad9797dd81a6bf1ae4e5a2 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 18 Jul 2014 20:12:27 +0100 Subject: Fix failed merge and other issues --- src/ClientHandle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 1a18649c9..f90da94dd 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -2375,9 +2375,9 @@ void cClientHandle::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effec -void cClientHandle::SendRespawn(eDimension a_Dimension) +void cClientHandle::SendRespawn(eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks) { - m_Protocol->SendRespawn(a_Dimension); + m_Protocol->SendRespawn(a_Dimension, a_ShouldIgnoreDimensionChecks); } -- cgit v1.2.3 From 6ab9afd0fd808fad99cd8387c72ce461c37aef80 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 20 Jul 2014 10:46:45 +0100 Subject: Bug and crash fixes * Fixes end portals' solidity * Fixed crashes to do with multithreading and removing an entity from the wrong world * Fixed crashes due to bad merge * Fixed crashes due to an object being deleted twice * Simplified cWorld::Start() and added comments to configuration files --- src/ClientHandle.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index f90da94dd..8caaae917 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -120,6 +120,8 @@ cClientHandle::~cClientHandle() } if (World != NULL) { + m_Player->SetWorldTravellingFrom(NULL); // Make sure that the player entity is actually removed + World->RemovePlayer(m_Player); // Must be called before cPlayer::Destroy() as otherwise cChunk tries to delete the player, and then we do it again m_Player->Destroy(); } delete m_Player; -- cgit v1.2.3 From 1156914dd60b4949116e57ec1480f81c39b6f292 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 23 Jul 2014 21:12:59 +0100 Subject: Suggestions --- src/ClientHandle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index af53d3623..aaed483e2 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -120,8 +120,8 @@ cClientHandle::~cClientHandle() } if (World != NULL) { - m_Player->SetWorldTravellingFrom(NULL); // Make sure that the player entity is actually removed - World->RemovePlayer(m_Player); // Must be called before cPlayer::Destroy() as otherwise cChunk tries to delete the player, and then we do it again + m_Player->SetWorldTravellingFrom(NULL); // Make sure that the player entity is actually removed + World->RemovePlayer(m_Player); // Must be called before cPlayer::Destroy() as otherwise cChunk tries to delete the player, and then we do it again m_Player->Destroy(); } delete m_Player; -- cgit v1.2.3