From 7fe70356b9e2186e807f11cbaa9d0baf09e0e129 Mon Sep 17 00:00:00 2001 From: "admin@omencraft.com" Date: Sat, 5 Nov 2011 19:31:25 +0000 Subject: Change SetBlock to FastSetBlock in cRedstone.cpp and grass will now grow if any one hit block is above it. git-svn-id: http://mc-server.googlecode.com/svn/trunk@65 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cRedstone.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'source/cRedstone.cpp') diff --git a/source/cRedstone.cpp b/source/cRedstone.cpp index d61d50cbb..1d865373b 100644 --- a/source/cRedstone.cpp +++ b/source/cRedstone.cpp @@ -18,53 +18,53 @@ void cRedstone::ChangeRedstoneTorch( int fillx, int filly, int fillz, bool added metadata = 0; } - cWorld* World = cRoot::Get()->GetWorld(); + //cWorld* World = cRoot::Get()->GetWorld(); - if ( ( (int)World->GetBlock( fillx+1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx+1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx+1, filly, fillz, metadata ); } - if ( ( (int)World->GetBlock( fillx-1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx-1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx-1, filly, fillz, metadata ); } - if ( ( (int)World->GetBlock( fillx, filly, fillz+1 ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx, filly, fillz+1 ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx, filly, fillz+1, metadata ); } - if ( ( (int)World->GetBlock( fillx, filly, fillz-1 ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx, filly, fillz-1 ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx, filly, fillz-1, metadata ); } - if ( ( (int)World->GetBlock( fillx+1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx+1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx+1, filly-1, fillz, metadata ); } - if ( ( (int)World->GetBlock( fillx-1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx-1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx-1, filly-1, fillz, metadata ); } - if ( ( (int)World->GetBlock( fillx, filly, fillz+1 ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx, filly, fillz+1 ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx, filly-1, fillz+1, metadata ); } - if ( ( (int)World->GetBlock( fillx, filly, fillz-1 ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx, filly, fillz-1 ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx, filly-1, fillz-1, metadata ); } - if ( ( (int)World->GetBlock( fillx+1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx+1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx+1, filly+1, fillz, metadata ); } - if ( ( (int)World->GetBlock( fillx-1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx-1, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx-1, filly+1, fillz, metadata ); } - if ( ( (int)World->GetBlock( fillx, filly, fillz+1 ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx, filly, fillz+1 ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx, filly+1, fillz+1, metadata ); } - if ( ( (int)World->GetBlock( fillx, filly, fillz-1 ) == E_BLOCK_REDSTONE_WIRE) ) { + if ( ( (int)m_World->GetBlock( fillx, filly, fillz-1 ) == E_BLOCK_REDSTONE_WIRE) ) { LightRedstone( fillx, filly+1, fillz-1, metadata ); } } void cRedstone::LightRedstone( int fillx, int filly, int fillz, char metadata) { - cWorld* World = cRoot::Get()->GetWorld(); - if ( ( (int)World->GetBlock( fillx, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) && ( (int)World->GetBlockMeta( fillx, filly, fillz) != metadata ) ) { - World->SetBlock( fillx, filly, fillz, (char)E_BLOCK_REDSTONE_WIRE, metadata ); + //cWorld* World = cRoot::Get()->GetWorld(); + if ( ( (int)m_World->GetBlock( fillx, filly, fillz ) == E_BLOCK_REDSTONE_WIRE) && ( (int)m_World->GetBlockMeta( fillx, filly, fillz) != metadata ) ) { + m_World->FastSetBlock( fillx, filly, fillz, (char)E_BLOCK_REDSTONE_WIRE, metadata ); LightRedstone(fillx-1,filly,fillz,metadata); LightRedstone(fillx+1,filly,fillz,metadata); LightRedstone(fillx,filly,fillz-1,metadata); -- cgit v1.2.3