From f84e8054534972246e223bf20fac25204849dab6 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 29 Aug 2020 21:34:21 +0100 Subject: Entities can fail to add into a chunk - MoveEntityToNewChunk, AddEntity can fail. Ensure we handle these cases correctly --- src/World.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/World.cpp') diff --git a/src/World.cpp b/src/World.cpp index dfc612229..c934c3650 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1023,13 +1023,7 @@ void cWorld::Tick(std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_La } for (auto & Entity : EntitiesToAdd) { - auto EntityPtr = Entity.get(); - ASSERT(EntityPtr->GetWorld() == this); m_ChunkMap->AddEntity(std::move(Entity)); - EntityPtr->OnAddToWorld(*this); - ASSERT(!EntityPtr->IsTicking()); - EntityPtr->SetIsTicking(true); - cPluginManager::Get()->CallHookSpawnedEntity(*this, *Entity); } EntitiesToAdd.clear(); -- cgit v1.2.3