1
0

Entities are never lost

This commit is contained in:
LogicParrot
2016-03-29 21:23:53 +03:00
parent 6d1d223d04
commit 630ceed2c0
3 changed files with 19 additions and 32 deletions

View File

@@ -693,10 +693,9 @@ void cChunk::MoveEntityToNewChunk(cEntity * a_Entity)
cChunk * Neighbor = GetNeighborChunk(a_Entity->GetChunkX() * cChunkDef::Width, a_Entity->GetChunkZ() * cChunkDef::Width);
if (Neighbor == nullptr)
{
Neighbor = m_ChunkMap->GetChunkNoLoad(a_Entity->GetChunkX(), a_Entity->GetChunkZ());
if (Neighbor == nullptr)
Neighbor = m_ChunkMap->GetChunk(a_Entity->GetChunkX(), a_Entity->GetChunkZ());
if (Neighbor == nullptr) // This will assert inside GetChunk in debug builds
{
// TODO: What to do with this?
LOGWARNING("%s: Failed to move entity, destination chunk unreachable. Entity lost", __FUNCTION__);
return;
}