diff options
author | STRWarrior <niels.breuker@hotmail.nl> | 2013-12-22 14:45:25 +0100 |
---|---|---|
committer | STRWarrior <niels.breuker@hotmail.nl> | 2013-12-22 14:45:25 +0100 |
commit | e9d1352f6e07d120253ea27ef84129ecc892c540 (patch) | |
tree | 27e52fb22ef2d6b4f3ec63732a51e0a05e27a6b5 /src/ChunkMap.cpp | |
parent | Using regular assignments. (diff) | |
download | cuberite-e9d1352f6e07d120253ea27ef84129ecc892c540.tar cuberite-e9d1352f6e07d120253ea27ef84129ecc892c540.tar.gz cuberite-e9d1352f6e07d120253ea27ef84129ecc892c540.tar.bz2 cuberite-e9d1352f6e07d120253ea27ef84129ecc892c540.tar.lz cuberite-e9d1352f6e07d120253ea27ef84129ecc892c540.tar.xz cuberite-e9d1352f6e07d120253ea27ef84129ecc892c540.tar.zst cuberite-e9d1352f6e07d120253ea27ef84129ecc892c540.zip |
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r-- | src/ChunkMap.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index c67d8e2e8..37f8df766 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -605,6 +605,25 @@ void cChunkMap::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animat +void cChunkMap::BroadcastParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount, cClientHandle * a_Exclude) +{ + cCSLock Lock(m_CSLayers); + int ChunkX, ChunkZ; + + cChunkDef::BlockToChunk(a_SrcX, a_SrcZ, ChunkX, ChunkZ); + cChunkPtr Chunk = GetChunkNoGen(ChunkX, 0, ChunkZ); + if (Chunk == NULL) + { + return; + } + // It's perfectly legal to broadcast packets even to invalid chunks! + Chunk->BroadcastParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmmount, a_Exclude); +} + + + + + void cChunkMap::BroadcastRemoveEntityEffect(const cEntity & a_Entity, int a_EffectID, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); |