summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormathiascode <mail@mathias.is>2020-05-03 00:37:35 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-05-03 12:49:00 +0200
commit5f2c572f9a68a43a0e9aed98fc08fdeab5a50ddf (patch)
tree2494361355387588ea6c7316e81c2e2b78635240 /src
parentUnify entity spawn packet sending (diff)
downloadcuberite-5f2c572f9a68a43a0e9aed98fc08fdeab5a50ddf.tar
cuberite-5f2c572f9a68a43a0e9aed98fc08fdeab5a50ddf.tar.gz
cuberite-5f2c572f9a68a43a0e9aed98fc08fdeab5a50ddf.tar.bz2
cuberite-5f2c572f9a68a43a0e9aed98fc08fdeab5a50ddf.tar.lz
cuberite-5f2c572f9a68a43a0e9aed98fc08fdeab5a50ddf.tar.xz
cuberite-5f2c572f9a68a43a0e9aed98fc08fdeab5a50ddf.tar.zst
cuberite-5f2c572f9a68a43a0e9aed98fc08fdeab5a50ddf.zip
Diffstat (limited to 'src')
-rw-r--r--src/Entities/Entity.cpp1
-rw-r--r--src/World.cpp1
2 files changed, 1 insertions, 1 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index e7b1c469f..0f1266445 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -154,6 +154,7 @@ bool cEntity::Initialize(OwnedEntity a_Self, cWorld & a_EntityWorld)
ASSERT(m_World == nullptr);
ASSERT(GetParentChunk() == nullptr);
+ SetWorld(&a_EntityWorld);
a_EntityWorld.AddEntity(std::move(a_Self));
return true;
diff --git a/src/World.cpp b/src/World.cpp
index c0838e1bf..2fde36259 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -1024,7 +1024,6 @@ void cWorld::Tick(std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_La
}
for (auto & Entity : EntitiesToAdd)
{
- Entity->SetWorld(this);
auto EntityPtr = Entity.get();
m_ChunkMap->AddEntity(std::move(Entity));
EntityPtr->OnAddToWorld(*this);