From 5d4591de472d43973478e1779c63607cf159ae87 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 6 May 2013 18:32:22 +0000 Subject: Fixed player teleporting too far away ("Entity lost") git-svn-id: http://mc-server.googlecode.com/svn/trunk@1452 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Chunk.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/Chunk.cpp b/source/Chunk.cpp index 723170bbf..0e10afd55 100644 --- a/source/Chunk.cpp +++ b/source/Chunk.cpp @@ -503,9 +503,13 @@ void cChunk::MoveEntityToNewChunk(cEntity * a_Entity) cChunk * Neighbor = GetNeighborChunk((int)a_Entity->GetPosX(), (int)a_Entity->GetPosZ()); if (Neighbor == NULL) { - // TODO: What to do with this? - LOGWARNING("%s: Failed to move entity, destination chunk unreachable. Entity lost", __FUNCTION__); - return; + Neighbor = m_ChunkMap->GetChunkNoLoad(a_Entity->GetChunkX(), ZERO_CHUNK_Y, a_Entity->GetChunkZ()); + if (Neighbor == NULL) + { + // TODO: What to do with this? + LOGWARNING("%s: Failed to move entity, destination chunk unreachable. Entity lost", __FUNCTION__); + return; + } } Neighbor->AddEntity(a_Entity); -- cgit v1.2.3