diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-11 14:01:34 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-11 14:01:34 +0200 |
commit | 9eed83c33ae8c2bbb1781a01f05326dba667f4e3 (patch) | |
tree | 339ae563c07ba06b55a7f127dbd8c52f83e4dd66 /source/cChunkMap.cpp | |
parent | Core's Web Chat should work on FireFox again. Apparently it appends "charset=utf-8" to the content type which was not properly handled. (diff) | |
download | cuberite-9eed83c33ae8c2bbb1781a01f05326dba667f4e3.tar cuberite-9eed83c33ae8c2bbb1781a01f05326dba667f4e3.tar.gz cuberite-9eed83c33ae8c2bbb1781a01f05326dba667f4e3.tar.bz2 cuberite-9eed83c33ae8c2bbb1781a01f05326dba667f4e3.tar.lz cuberite-9eed83c33ae8c2bbb1781a01f05326dba667f4e3.tar.xz cuberite-9eed83c33ae8c2bbb1781a01f05326dba667f4e3.tar.zst cuberite-9eed83c33ae8c2bbb1781a01f05326dba667f4e3.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cChunkMap.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp index 5f9724179..d88a82b0f 100644 --- a/source/cChunkMap.cpp +++ b/source/cChunkMap.cpp @@ -447,6 +447,25 @@ void cChunkMap::BroadcastThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ, c +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); + int ChunkX, ChunkZ; + + cChunkDef::BlockToChunk(a_SrcX / 8, a_SrcY / 8, a_SrcZ / 8, ChunkX, ChunkZ); + cChunkPtr Chunk = GetChunkNoGen(ChunkX, 0, ChunkZ); + if (Chunk == NULL) + { + return; + } + // It's perfectly legal to broadcast packets even to invalid chunks! + Chunk->BroadcastSoundEffect(a_SoundName, a_SrcX, a_SrcY, a_SrcZ, a_Volume, a_Pitch, a_Exclude); +} + + + + + void cChunkMap::BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); |