summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-17 22:23:08 +0200
committermadmaxoft <github@xoft.cz>2014-07-17 22:23:08 +0200
commit7a9f9ab744e88267299b347ac6c9171acfe3afaa (patch)
tree7cc853f2e143ec42948e5b44f207d286cc9db039 /src/ChunkMap.cpp
parentInitial version of a script to check basic style. (diff)
parentMerge pull request #1204 from Howaner/Blocks (diff)
downloadcuberite-7a9f9ab744e88267299b347ac6c9171acfe3afaa.tar
cuberite-7a9f9ab744e88267299b347ac6c9171acfe3afaa.tar.gz
cuberite-7a9f9ab744e88267299b347ac6c9171acfe3afaa.tar.bz2
cuberite-7a9f9ab744e88267299b347ac6c9171acfe3afaa.tar.lz
cuberite-7a9f9ab744e88267299b347ac6c9171acfe3afaa.tar.xz
cuberite-7a9f9ab744e88267299b347ac6c9171acfe3afaa.tar.zst
cuberite-7a9f9ab744e88267299b347ac6c9171acfe3afaa.zip
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r--src/ChunkMap.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index de2016015..9f280f1c5 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -1737,7 +1737,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;
}