Fixed player spawning #953.
This commit is contained in:
parent
051bb8cfbd
commit
4c165f8a6d
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user