diff options
author | Pokechu22 <Pokechu22@users.noreply.github.com> | 2016-05-14 21:12:42 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2016-05-14 21:12:42 +0200 |
commit | a4f327118b06ced1cd4510b7d20d34da83aa78a3 (patch) | |
tree | d6dbd41cfbec99f2598fb51907b86d9cbe0e8a05 /src/ChunkMap.cpp | |
parent | Fixed death on teleportation or leaving Minecart (#3181) (diff) | |
download | cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.gz cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.bz2 cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.lz cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.xz cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.zst cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.zip |
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r-- | src/ChunkMap.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 7d1685210..83c1c12dd 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -338,7 +338,7 @@ cChunk * cChunkMap::FindChunk(int a_ChunkX, int a_ChunkZ) -void cChunkMap::BroadcastAttachEntity(const cEntity & a_Entity, const cEntity * a_Vehicle) +void cChunkMap::BroadcastAttachEntity(const cEntity & a_Entity, const cEntity & a_Vehicle) { cCSLock Lock(m_CSLayers); cChunkPtr Chunk = GetChunkNoGen(a_Entity.GetChunkX(), a_Entity.GetChunkZ()); @@ -442,6 +442,22 @@ void cChunkMap::BroadcastDestroyEntity(const cEntity & a_Entity, const cClientHa +void cChunkMap::BroadcastDetachEntity(const cEntity & a_Entity, const cEntity & a_PreviousVehicle) +{ + cCSLock Lock(m_CSLayers); + cChunkPtr Chunk = GetChunkNoGen(a_Entity.GetChunkX(), a_Entity.GetChunkZ()); + if (Chunk == nullptr) + { + return; + } + // It's perfectly legal to broadcast packets even to invalid chunks! + Chunk->BroadcastDetachEntity(a_Entity, a_PreviousVehicle); +} + + + + + void cChunkMap::BroadcastEntityEffect(const cEntity & a_Entity, int a_EffectID, int a_Amplifier, short a_Duration, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); |