diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Entities/Entity.cpp | 3 | ||||
-rw-r--r-- | src/World.cpp | 2 |
2 files changed, 1 insertions, 4 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index a4d33db19..453bd03d2 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -154,9 +154,6 @@ bool cEntity::Initialize(OwnedEntity a_Self, cWorld & a_EntityWorld) ASSERT(m_World == nullptr); ASSERT(GetParentChunk() == nullptr); a_EntityWorld.AddEntity(std::move(a_Self)); - ASSERT(m_World != nullptr); - - cPluginManager::Get()->CallHookSpawnedEntity(a_EntityWorld, *this); return true; } diff --git a/src/World.cpp b/src/World.cpp index fdb66b87d..2df7ef4eb 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1032,6 +1032,7 @@ void cWorld::Tick(std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_La EntityPtr->OnAddToWorld(*this); ASSERT(!EntityPtr->IsTicking()); EntityPtr->SetIsTicking(true); + cPluginManager::Get()->CallHookSpawnedEntity(*this, *Entity); } EntitiesToAdd.clear(); @@ -3088,7 +3089,6 @@ void cWorld::ScheduleTask(int a_DelayTicks, std::function<void (cWorld &)> a_Tas void cWorld::AddEntity(OwnedEntity a_Entity) { - a_Entity->SetWorld(this); cCSLock Lock(m_CSEntitiesToAdd); m_EntitiesToAdd.emplace_back(std::move(a_Entity)); } |