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/Chunk.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/Chunk.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index b3c1896dc..3eb46213c 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -2589,6 +2589,22 @@ void cChunk::BroadcastDestroyEntity(const cEntity & a_Entity, const cClientHandl +void cChunk::BroadcastEntityEffect(const cEntity & a_Entity, int a_EffectID, int a_Amplifier, short a_Duration, const cClientHandle * a_Exclude) +{ + for (cClientHandleList::const_iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr ) + { + if (*itr == a_Exclude) + { + continue; + } + (*itr)->SendEntityEffect(a_Entity, a_EffectID, a_Amplifier, a_Duration); + } // for itr - LoadedByClient[] +} + + + + + void cChunk::BroadcastEntityEquipment(const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item, const cClientHandle * a_Exclude) { for (cClientHandleList::const_iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr ) @@ -2733,6 +2749,22 @@ void cChunk::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation +void cChunk::BroadcastRemoveEntityEffect(const cEntity & a_Entity, int a_EffectID, const cClientHandle * a_Exclude) +{ + for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr ) + { + if (*itr == a_Exclude) + { + continue; + } + (*itr)->SendRemoveEntityEffect(a_Entity, a_EffectID); + } // for itr - LoadedByClient[] +} + + + + + void cChunk::BroadcastSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude) { for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr ) |