From db36f1a9fad7a79d489c36abd6140e7b48f7d413 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 17 Jul 2014 13:54:28 +0100 Subject: Fixed crash with entities in unloaded chunks * Fixes #1190 --- src/ChunkMap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index b9bb39aa8..e2cf50314 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1736,7 +1736,9 @@ void cChunkMap::RemoveEntity(cEntity * a_Entity) { cCSLock Lock(m_CSLayers); cChunkPtr Chunk = GetChunkNoGen(a_Entity->GetChunkX(), ZERO_CHUNK_Y, a_Entity->GetChunkZ()); - if ((Chunk == NULL) || !Chunk->IsValid()) + + // Even if a chunk is not valid, it may still contain entities such as players; make sure to remove them (#1190) + if (Chunk == NULL) { return; } -- cgit v1.2.3