summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-04-27 23:11:21 +0200
committermadmaxoft <github@xoft.cz>2014-04-27 23:11:36 +0200
commit4c165f8a6ddd40cee7769b622d4b357e1d35c26a (patch)
treeebfd8a1d49066fb95e65d43bab0b779b2d7554cf
parentMerge pull request #958 from worktycho/bugfix (diff)
downloadcuberite-4c165f8a6ddd40cee7769b622d4b357e1d35c26a.tar
cuberite-4c165f8a6ddd40cee7769b622d4b357e1d35c26a.tar.gz
cuberite-4c165f8a6ddd40cee7769b622d4b357e1d35c26a.tar.bz2
cuberite-4c165f8a6ddd40cee7769b622d4b357e1d35c26a.tar.lz
cuberite-4c165f8a6ddd40cee7769b622d4b357e1d35c26a.tar.xz
cuberite-4c165f8a6ddd40cee7769b622d4b357e1d35c26a.tar.zst
cuberite-4c165f8a6ddd40cee7769b622d4b357e1d35c26a.zip
-rw-r--r--src/ChunkMap.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index 0fb6988b5..537d491c9 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -1654,7 +1654,10 @@ void cChunkMap::AddEntity(cEntity * a_Entity)
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_Entity->GetChunkX(), ZERO_CHUNK_Y, a_Entity->GetChunkZ());
- if ((Chunk == NULL) || !Chunk->IsValid())
+ if (
+ (Chunk == NULL) || // Chunk not present at all
+ (!Chunk->IsValid() && !a_Entity->IsPlayer()) // Chunk present, but no valid data; players need to spawn in such chunks (#953)
+ )
{
LOGWARNING("Entity at %p (%s, ID %d) spawning in a non-existent chunk, the entity is lost.",
a_Entity, a_Entity->GetClass(), a_Entity->GetUniqueID()