summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-17 14:54:28 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-17 14:54:28 +0200
commitdb36f1a9fad7a79d489c36abd6140e7b48f7d413 (patch)
tree52b6aec2ac054f11ec83940fea17273484c384cf
parentMerge pull request #1183 from Howaner/Sounds (diff)
downloadcuberite-db36f1a9fad7a79d489c36abd6140e7b48f7d413.tar
cuberite-db36f1a9fad7a79d489c36abd6140e7b48f7d413.tar.gz
cuberite-db36f1a9fad7a79d489c36abd6140e7b48f7d413.tar.bz2
cuberite-db36f1a9fad7a79d489c36abd6140e7b48f7d413.tar.lz
cuberite-db36f1a9fad7a79d489c36abd6140e7b48f7d413.tar.xz
cuberite-db36f1a9fad7a79d489c36abd6140e7b48f7d413.tar.zst
cuberite-db36f1a9fad7a79d489c36abd6140e7b48f7d413.zip
-rw-r--r--src/ChunkMap.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}