summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-01 21:00:11 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-01 21:00:11 +0200
commita84f107400a326b0be27c290359220b8bf0e6635 (patch)
tree274bf3c559817531757773fda8b6047a529e0606
parentSuggestions (diff)
downloadcuberite-a84f107400a326b0be27c290359220b8bf0e6635.tar
cuberite-a84f107400a326b0be27c290359220b8bf0e6635.tar.gz
cuberite-a84f107400a326b0be27c290359220b8bf0e6635.tar.bz2
cuberite-a84f107400a326b0be27c290359220b8bf0e6635.tar.lz
cuberite-a84f107400a326b0be27c290359220b8bf0e6635.tar.xz
cuberite-a84f107400a326b0be27c290359220b8bf0e6635.tar.zst
cuberite-a84f107400a326b0be27c290359220b8bf0e6635.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockPiston.cpp6
-rw-r--r--src/Chunk.cpp16
2 files changed, 12 insertions, 10 deletions
diff --git a/src/Blocks/BlockPiston.cpp b/src/Blocks/BlockPiston.cpp
index 1f8e0d9e0..faf639312 100644
--- a/src/Blocks/BlockPiston.cpp
+++ b/src/Blocks/BlockPiston.cpp
@@ -76,15 +76,15 @@ bool cBlockPistonHandler::GetPlacementBlockTypeMeta(
-int cBlockPistonHandler::FirstPassthroughBlock(int pistonX, int pistonY, int pistonZ, NIBBLETYPE pistonmeta, cWorld * a_World)
+int cBlockPistonHandler::FirstPassthroughBlock(int a_PistonX, int a_PistonY, int a_PistonZ, NIBBLETYPE pistonmeta, cWorld * a_World)
{
// Examine each of the 12 blocks ahead of the piston:
for (int ret = 0; ret < PISTON_MAX_PUSH_DISTANCE; ret++)
{
BLOCKTYPE currBlock;
NIBBLETYPE currMeta;
- AddPistonDir(pistonX, pistonY, pistonZ, pistonmeta, 1);
- a_World->GetBlockTypeMeta(pistonX, pistonY, pistonZ, currBlock, currMeta);
+ AddPistonDir(a_PistonX, a_PistonY, a_PistonZ, pistonmeta, 1);
+ a_World->GetBlockTypeMeta(a_PistonX, a_PistonY, a_PistonZ, currBlock, currMeta);
if (CanBreakPush(currBlock))
{
// This block breaks when pushed, extend up to here
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index fbd0a5846..6dce29e68 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -1589,13 +1589,15 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT
if ( // Queue block to be sent only if ...
a_SendToClients && // ... we are told to do so AND ...
- ((OldBlockMeta != a_BlockMeta) || // ... the meta value is different OR ...
- !( // ... the old and new blocktypes AREN'T liquids (because client doesn't need to distinguish betwixt them); see below for specifics:
- ((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
- ))
+ (
+ (OldBlockMeta != a_BlockMeta) || // ... the meta value is different OR ...
+ !( // ... the old and new blocktypes AREN'T liquids (because client doesn't need to distinguish betwixt them); see below for specifics:
+ ((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));