diff options
author | Mattes D <github@xoft.cz> | 2020-04-12 13:34:24 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2020-04-12 13:34:24 +0200 |
commit | fb05ea7cf740ecd59b24d4f7417ad44c30ba53d5 (patch) | |
tree | c3723655ff577be1df26573405635d0280249ceb /src | |
parent | Removed extended ASCII, and added a check against it. (#4642) (diff) | |
download | cuberite-fb05ea7cf740ecd59b24d4f7417ad44c30ba53d5.tar cuberite-fb05ea7cf740ecd59b24d4f7417ad44c30ba53d5.tar.gz cuberite-fb05ea7cf740ecd59b24d4f7417ad44c30ba53d5.tar.bz2 cuberite-fb05ea7cf740ecd59b24d4f7417ad44c30ba53d5.tar.lz cuberite-fb05ea7cf740ecd59b24d4f7417ad44c30ba53d5.tar.xz cuberite-fb05ea7cf740ecd59b24d4f7417ad44c30ba53d5.tar.zst cuberite-fb05ea7cf740ecd59b24d4f7417ad44c30ba53d5.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Entities/Entity.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index e7682e6da..3ff48440c 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1893,7 +1893,11 @@ void cEntity::TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) if (!cRoot::Get()->GetPluginManager()->CallHookEntityTeleport(*this, m_LastPosition, Vector3d(a_PosX, a_PosY, a_PosZ))) { ResetPosition({a_PosX, a_PosY, a_PosZ}); - m_World->BroadcastTeleportEntity(*this); + auto world = m_World; + if (world != nullptr) // The entity might not be in a world yet (just spawned, in cWorld::m_EntitiesToAdd) + { + world->BroadcastTeleportEntity(*this); + } } } |