diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-25 23:46:18 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-25 23:46:18 +0200 |
commit | 7157ebc061b496d84c685070107045e8440a6ef0 (patch) | |
tree | 46ae305d432f61b0fef5363b49ea534bcafdab10 /source/cChunkMap.cpp | |
parent | Removed cPackets from cChunk. (diff) | |
download | cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.gz cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.bz2 cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.lz cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.xz cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.zst cuberite-7157ebc061b496d84c685070107045e8440a6ef0.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cChunkMap.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp index c5a770871..16e250869 100644 --- a/source/cChunkMap.cpp +++ b/source/cChunkMap.cpp @@ -467,6 +467,24 @@ void cChunkMap::BroadcastCollectPickup(const cPickup & a_Pickup, const cPlayer & +void cChunkMap::BroadcastThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude) +{ + cCSLock Lock(m_CSLayers); + int ChunkX, ChunkZ; + cChunkDef::BlockToChunk(a_BlockX, a_BlockY, a_BlockZ, ChunkX, ChunkZ); + cChunkPtr Chunk = GetChunkNoGen(ChunkX, 0, ChunkZ); + if (Chunk == NULL) + { + return; + } + // It's perfectly legal to broadcast packets even to invalid chunks! + Chunk->BroadcastThunderbolt(a_BlockX, a_BlockY, a_BlockZ, a_Exclude); +} + + + + + void cChunkMap::BroadcastBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); |