From f0145ee9fa09ce2c27b8149fee37c6f5fce7e1da Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 21 Feb 2012 15:18:02 +0000 Subject: Fixed heightmap optimization from rev 302; removed a few more cChunkPtrs git-svn-id: http://mc-server.googlecode.com/svn/trunk@303 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPiston.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source/cPiston.cpp') 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 +} + + + + -- cgit v1.2.3