diff options
author | Mattes D <github@xoft.cz> | 2013-12-15 13:42:15 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-12-15 13:42:15 +0100 |
commit | 4f92f18a8d97c749d25754a528cea2cc7a90dcf2 (patch) | |
tree | c2135e33e7ab30a548dcaac99e7f2cafc8bb2c4c /src/ChunkMap.cpp | |
parent | Fixed pre 1.7 clients crashing. (diff) | |
parent | cPlayer is using the broadcast functions. (diff) | |
download | cuberite-4f92f18a8d97c749d25754a528cea2cc7a90dcf2.tar cuberite-4f92f18a8d97c749d25754a528cea2cc7a90dcf2.tar.gz cuberite-4f92f18a8d97c749d25754a528cea2cc7a90dcf2.tar.bz2 cuberite-4f92f18a8d97c749d25754a528cea2cc7a90dcf2.tar.lz cuberite-4f92f18a8d97c749d25754a528cea2cc7a90dcf2.tar.xz cuberite-4f92f18a8d97c749d25754a528cea2cc7a90dcf2.tar.zst cuberite-4f92f18a8d97c749d25754a528cea2cc7a90dcf2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ChunkMap.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index f2195741d..53b595545 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -445,6 +445,22 @@ void cChunkMap::BroadcastDestroyEntity(const cEntity & a_Entity, const cClientHa +void cChunkMap::BroadcastEntityEffect(const cEntity & a_Entity, int a_EffectID, int a_Amplifier, short a_Duration, const cClientHandle * a_Exclude) +{ + cCSLock Lock(m_CSLayers); + cChunkPtr Chunk = GetChunkNoGen(a_Entity.GetChunkX(), ZERO_CHUNK_Y, a_Entity.GetChunkZ()); + if (Chunk == NULL) + { + return; + } + // It's perfectly legal to broadcast packets even to invalid chunks! + Chunk->BroadcastEntityEffect(a_Entity, a_EffectID, a_Amplifier, a_Duration); +} + + + + + void cChunkMap::BroadcastEntityEquipment(const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); @@ -589,6 +605,23 @@ void cChunkMap::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animat +void cChunkMap::BroadcastRemoveEntityEffect(const cEntity & a_Entity, int a_EffectID, const cClientHandle * a_Exclude) +{ + cCSLock Lock(m_CSLayers); + + cChunkPtr Chunk = GetChunkNoGen(a_Entity.GetChunkX(), ZERO_CHUNK_Y, a_Entity.GetChunkZ()); + if (Chunk == NULL) + { + return; + } + // It's perfectly legal to broadcast packets even to invalid chunks! + Chunk->BroadcastRemoveEntityEffect(a_Entity, a_EffectID, a_Exclude); +} + + + + + void cChunkMap::BroadcastSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); |