From 508d5d6e120fa8706dd4479ad5aa062967c55fcd Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 7 Jun 2012 09:46:00 +0000 Subject: Fixed a typo in grass spreading causing much of the "too many packets" error. git-svn-id: http://mc-server.googlecode.com/svn/trunk@567 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/cChunk.cpp b/source/cChunk.cpp index 46c7d78ad..4eaa9d864 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -606,10 +606,13 @@ void cChunk::TickBlocks(MTRand & a_TickRandom) void cChunk::TickGrass(int a_RelX, int a_RelY, int a_RelZ, MTRand & a_TickRandom) { // Grass turns into dirt if there's another block on top of it: - BLOCKTYPE AboveBlock = cChunkDef::GetBlock(m_BlockTypes, a_RelX, a_RelY + 1, a_RelZ); - if (!((g_BlockOneHitDig[AboveBlock]) || (g_BlockTransparent[AboveBlock]))) { - FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, 0); + BLOCKTYPE AboveBlock = cChunkDef::GetBlock(m_BlockTypes, a_RelX, a_RelY + 1, a_RelZ); + if (!((g_BlockOneHitDig[AboveBlock]) || (g_BlockTransparent[AboveBlock]))) + { + FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, 0); + return; + } } // Grass spreads to nearby blocks if there's enough light (TODO) and free space above that block @@ -634,13 +637,13 @@ void cChunk::TickGrass(int a_RelX, int a_RelY, int a_RelZ, MTRand & a_TickRandom NIBBLETYPE AboveMeta; if ( UnboundedRelGetBlock(a_RelX + OfsX, a_RelY + OfsY + 1, a_RelZ + OfsZ, AboveDest, AboveMeta) && - ((g_BlockOneHitDig[AboveBlock]) || (g_BlockTransparent[AboveBlock])) + ((g_BlockOneHitDig[AboveDest]) || (g_BlockTransparent[AboveDest])) // TODO: Query dest light, if it's enough ) { UnboundedRelFastSetBlock(a_RelX + OfsX, a_RelY + OfsY, a_RelZ + OfsZ, E_BLOCK_GRASS, 0); } - } + } // for i - repeat twice } -- cgit v1.2.3