1
0

Fixed player spawning #953.

This commit is contained in:
madmaxoft 2014-04-27 23:11:21 +02:00
parent 051bb8cfbd
commit 4c165f8a6d

View File

@ -1654,7 +1654,10 @@ void cChunkMap::AddEntity(cEntity * a_Entity)
{ {
cCSLock Lock(m_CSLayers); cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_Entity->GetChunkX(), ZERO_CHUNK_Y, a_Entity->GetChunkZ()); 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.", 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() a_Entity, a_Entity->GetClass(), a_Entity->GetUniqueID()