diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-25 14:46:34 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-25 14:46:34 +0200 |
commit | ee929793f09c431693e1bef7edd77213ba412f60 (patch) | |
tree | 566189dcea2b6cac9d3bd2958026b9ad9a264027 /src/Chunk.cpp | |
parent | Updated Core (diff) | |
download | cuberite-ee929793f09c431693e1bef7edd77213ba412f60.tar cuberite-ee929793f09c431693e1bef7edd77213ba412f60.tar.gz cuberite-ee929793f09c431693e1bef7edd77213ba412f60.tar.bz2 cuberite-ee929793f09c431693e1bef7edd77213ba412f60.tar.lz cuberite-ee929793f09c431693e1bef7edd77213ba412f60.tar.xz cuberite-ee929793f09c431693e1bef7edd77213ba412f60.tar.zst cuberite-ee929793f09c431693e1bef7edd77213ba412f60.zip |
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r-- | src/Chunk.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index ca536e89a..6bd68459c 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1462,9 +1462,9 @@ void cChunk::CalculateHeightmap(const BLOCKTYPE * a_BlockTypes) -void cChunk::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) +void cChunk::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, bool a_SendToClients) { - FastSetBlock(a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta); + FastSetBlock(a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta, a_SendToClients); const int index = MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ); @@ -1565,7 +1565,7 @@ void cChunk::QueueTickBlockNeighbors(int a_RelX, int a_RelY, int a_RelZ) -void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta) +void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta, bool a_SendToClients) { ASSERT(!((a_RelX < 0) || (a_RelX >= Width) || (a_RelY < 0) || (a_RelY >= Height) || (a_RelZ < 0) || (a_RelZ >= Width))); @@ -1589,13 +1589,14 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT // The client doesn't need to distinguish between stationary and nonstationary fluids: if ( - (OldBlockMeta != a_BlockMeta) || // Different meta always gets sent to the client + a_SendToClients && + ((OldBlockMeta != a_BlockMeta) || // Different meta always gets sent to the client !( ((OldBlockType == E_BLOCK_STATIONARY_WATER) && (a_BlockType == E_BLOCK_WATER)) || // Replacing stationary water with water ((OldBlockType == E_BLOCK_WATER) && (a_BlockType == E_BLOCK_STATIONARY_WATER)) || // Replacing water with stationary water ((OldBlockType == E_BLOCK_STATIONARY_LAVA) && (a_BlockType == E_BLOCK_LAVA)) || // Replacing stationary water with water ((OldBlockType == E_BLOCK_LAVA) && (a_BlockType == E_BLOCK_STATIONARY_LAVA)) // Replacing water with stationary water - ) + )) ) { m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta)); |