diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-21 16:18:02 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-21 16:18:02 +0100 |
commit | f0145ee9fa09ce2c27b8149fee37c6f5fce7e1da (patch) | |
tree | 9eaa3d17bbeda373649470cd5ce060c4fbf76b58 /source/cPiston.cpp | |
parent | Optimized hightmap recalc when setting a chunk's block (diff) | |
download | cuberite-f0145ee9fa09ce2c27b8149fee37c6f5fce7e1da.tar cuberite-f0145ee9fa09ce2c27b8149fee37c6f5fce7e1da.tar.gz cuberite-f0145ee9fa09ce2c27b8149fee37c6f5fce7e1da.tar.bz2 cuberite-f0145ee9fa09ce2c27b8149fee37c6f5fce7e1da.tar.lz cuberite-f0145ee9fa09ce2c27b8149fee37c6f5fce7e1da.tar.xz cuberite-f0145ee9fa09ce2c27b8149fee37c6f5fce7e1da.tar.zst cuberite-f0145ee9fa09ce2c27b8149fee37c6f5fce7e1da.zip |
Diffstat (limited to 'source/cPiston.cpp')
-rw-r--r-- | source/cPiston.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/source/cPiston.cpp b/source/cPiston.cpp index cc6d48ca9..9c4363eeb 100644 --- a/source/cPiston.cpp +++ b/source/cPiston.cpp @@ -88,9 +88,7 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz ) { Action.m_Byte1 = 0;
Action.m_Byte2 = pistonMeta;
-
- cChunkPtr Chunk = m_World->GetChunkOfBlock(pistx, pisty, pistz);
- Chunk->Broadcast( Action );
+ m_World->BroadcastToChunkOfBlock(pistx, pisty, pistz, &Action);
m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 8 );
int extx = pistx;
@@ -106,9 +104,7 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz ) { Redstone.ChangeRedstone( extx, exty, extz, false ); //recalculate redstone around current device.
Redstone.ChangeRedstone( pistx, pisty, pistz, false ); //recalculate redstone around current device.
}
-
}
-
}
@@ -131,8 +127,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) Action.m_PosZ = (int)pistz;
Action.m_Byte1 = 1;
Action.m_Byte2 = pistonMeta & ~(8);
- cChunkPtr Chunk = m_World->GetChunkOfBlock(pistx, pisty, pistz);
- Chunk->Broadcast( Action );
+ m_World->BroadcastToChunkOfBlock(pistx, pisty, pistz, &Action );
m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8) );
AddDir( pistx, pisty, pistz, pistonMeta & 7, 1 )
@@ -160,4 +155,8 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) m_World->SetBlock( pistx, pisty, pistz, E_BLOCK_AIR, 0 );
}
}
-}
\ No newline at end of file +}
+
+
+
+
|