1
0

Assert if world is incorrect

This commit is contained in:
Mat 2020-05-03 02:58:53 +03:00 committed by Tiger Wang
parent 5f2c572f9a
commit f5ce03d10d

View File

@ -1025,6 +1025,7 @@ void cWorld::Tick(std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_La
for (auto & Entity : EntitiesToAdd) for (auto & Entity : EntitiesToAdd)
{ {
auto EntityPtr = Entity.get(); auto EntityPtr = Entity.get();
ASSERT(EntityPtr->GetWorld() == this);
m_ChunkMap->AddEntity(std::move(Entity)); m_ChunkMap->AddEntity(std::move(Entity));
EntityPtr->OnAddToWorld(*this); EntityPtr->OnAddToWorld(*this);
ASSERT(!EntityPtr->IsTicking()); ASSERT(!EntityPtr->IsTicking());