From cd97aa83307ce33068082dc57deee8d922fec432 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 10 Jul 2022 23:55:11 +0100 Subject: Pickups: improve coalescing implementation + Add ability to coalesce before spawning in to world. * Adapt coalescing for pickup entities already in the world to be more like Vanilla. --- src/ChunkMap.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ChunkMap.cpp') diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 82631e6ed..110a1f8f7 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -916,14 +916,15 @@ void cChunkMap::AddEntity(OwnedEntity a_Entity) } const auto EntityPtr = a_Entity.get(); - ASSERT(EntityPtr->GetWorld() == m_World); auto & Chunk = ConstructChunk(a_Entity->GetChunkX(), a_Entity->GetChunkZ()); Chunk.AddEntity(std::move(a_Entity)); - EntityPtr->OnAddToWorld(*m_World); ASSERT(!EntityPtr->IsTicking()); + ASSERT(EntityPtr->GetWorld() == m_World); + EntityPtr->SetIsTicking(true); + EntityPtr->OnAddToWorld(*m_World); cPluginManager::Get()->CallHookSpawnedEntity(*m_World, *EntityPtr); } -- cgit v1.2.3