1
0

Fixed player teleporting too far away ("Entity lost")

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1452 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-05-06 18:32:22 +00:00
parent 205ee49c79
commit 5d4591de47

View File

@ -502,11 +502,15 @@ void cChunk::MoveEntityToNewChunk(cEntity * a_Entity)
{
cChunk * Neighbor = GetNeighborChunk((int)a_Entity->GetPosX(), (int)a_Entity->GetPosZ());
if (Neighbor == NULL)
{
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);