summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-07 11:46:00 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-07 11:46:00 +0200
commit508d5d6e120fa8706dd4479ad5aa062967c55fcd (patch)
tree67908355177a60319f073d6013ed7255ff44bc6c
parentAdded more statistics to the packet queue overfill problem. (diff)
downloadcuberite-508d5d6e120fa8706dd4479ad5aa062967c55fcd.tar
cuberite-508d5d6e120fa8706dd4479ad5aa062967c55fcd.tar.gz
cuberite-508d5d6e120fa8706dd4479ad5aa062967c55fcd.tar.bz2
cuberite-508d5d6e120fa8706dd4479ad5aa062967c55fcd.tar.lz
cuberite-508d5d6e120fa8706dd4479ad5aa062967c55fcd.tar.xz
cuberite-508d5d6e120fa8706dd4479ad5aa062967c55fcd.tar.zst
cuberite-508d5d6e120fa8706dd4479ad5aa062967c55fcd.zip
Diffstat (limited to '')
-rw-r--r--source/cChunk.cpp13
1 files 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
}