Merge pull request #3044 from LogicParrot/chunkRemove
Fixed removing entities from parent chunks
This commit is contained in:
commit
3c671b9c23
@ -1685,7 +1685,7 @@ bool cChunkMap::HasEntity(UInt32 a_UniqueID)
|
|||||||
void cChunkMap::RemoveEntity(cEntity * a_Entity)
|
void cChunkMap::RemoveEntity(cEntity * a_Entity)
|
||||||
{
|
{
|
||||||
cCSLock Lock(m_CSLayers);
|
cCSLock Lock(m_CSLayers);
|
||||||
cChunkPtr Chunk = GetChunkNoGen(a_Entity->GetChunkX(), a_Entity->GetChunkZ());
|
cChunkPtr Chunk = a_Entity->GetParentChunk();
|
||||||
|
|
||||||
// Even if a chunk is not valid, it may still contain entities such as players; make sure to remove them (#1190)
|
// Even if a chunk is not valid, it may still contain entities such as players; make sure to remove them (#1190)
|
||||||
if (Chunk == nullptr)
|
if (Chunk == nullptr)
|
||||||
|
Loading…
Reference in New Issue
Block a user