diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-29 22:43:42 +0200 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-29 22:43:42 +0200 |
commit | 17486c785331e809f5294fee40367b1590e0d36b (patch) | |
tree | 3104a260f3eac320a190af73a3dced00cb77bcfe /source/ChunkMap.cpp | |
parent | Fixed memory leaks in cWindow and cProtocolRecognizer (diff) | |
download | cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.gz cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.bz2 cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.lz cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.xz cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.zst cuberite-17486c785331e809f5294fee40367b1590e0d36b.zip |
Diffstat (limited to 'source/ChunkMap.cpp')
-rw-r--r-- | source/ChunkMap.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/ChunkMap.cpp b/source/ChunkMap.cpp index ee69e6cc0..af8f09820 100644 --- a/source/ChunkMap.cpp +++ b/source/ChunkMap.cpp @@ -484,6 +484,25 @@ void cChunkMap::BroadcastBlockBreakAnimation(int a_entityID, int a_blockX, int a +void cChunkMap::BroadcastUseBed(const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) +{ + 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->BroadcastUseBed(a_Entity, a_BlockX, a_BlockY, a_BlockZ); +} + + + + + void cChunkMap::BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); |