summaryrefslogtreecommitdiffstats
path: root/source/cEntity.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cEntity.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/cEntity.cpp b/source/cEntity.cpp
index b8cc26199..c22be3def 100644
--- a/source/cEntity.cpp
+++ b/source/cEntity.cpp
@@ -75,6 +75,8 @@ void cEntity::WrapRotation()
void cEntity::MoveToCorrectChunk()
{
+ if( !m_World ) return; // Entity needs a world to move to a chunk
+
int ChunkX = 0, ChunkY = 0, ChunkZ = 0;
cWorld::BlockToChunk( (int)m_Pos->x, (int)m_Pos->y, (int)m_Pos->z, ChunkX, ChunkY, ChunkZ );
if( m_ChunkX != ChunkX || m_ChunkY != ChunkY || m_ChunkZ != ChunkZ )