summaryrefslogtreecommitdiffstats
path: root/source/cChunkMap.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-25 23:46:18 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-25 23:46:18 +0200
commit7157ebc061b496d84c685070107045e8440a6ef0 (patch)
tree46ae305d432f61b0fef5363b49ea534bcafdab10 /source/cChunkMap.cpp
parentRemoved cPackets from cChunk. (diff)
downloadcuberite-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.cpp18
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);