summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-06 20:32:22 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-06 20:32:22 +0200
commit5d4591de472d43973478e1779c63607cf159ae87 (patch)
tree8131da356da4b66fe8443d3d303caea843ca5bd5 /source
parentDistortedHeightmap: Optimized by linear interpolation (diff)
downloadcuberite-5d4591de472d43973478e1779c63607cf159ae87.tar
cuberite-5d4591de472d43973478e1779c63607cf159ae87.tar.gz
cuberite-5d4591de472d43973478e1779c63607cf159ae87.tar.bz2
cuberite-5d4591de472d43973478e1779c63607cf159ae87.tar.lz
cuberite-5d4591de472d43973478e1779c63607cf159ae87.tar.xz
cuberite-5d4591de472d43973478e1779c63607cf159ae87.tar.zst
cuberite-5d4591de472d43973478e1779c63607cf159ae87.zip
Diffstat (limited to 'source')
-rw-r--r--source/Chunk.cpp10
1 files changed, 7 insertions, 3 deletions
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);