From 7f5757eccff7b81c17443ea4e0b4ce86e2d5dc04 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Mon, 18 Apr 2016 13:30:23 +0300 Subject: Reduced unnecessary block updates --- src/Generating/StructGen.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Generating/StructGen.cpp') diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp index 9b4eb67ef..c1e6906fc 100644 --- a/src/Generating/StructGen.cpp +++ b/src/Generating/StructGen.cpp @@ -183,6 +183,14 @@ void cStructGenTrees::ApplyTreeImage( CASE_TREE_OVERWRITTEN_BLOCKS: { a_ChunkDesc.SetBlockTypeMeta(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockType, itr->m_BlockMeta); + // If grass is below our tree, turn it to dirt + if ( + (cBlockInfo::IsSolid(itr->m_BlockType)) && + (a_ChunkDesc.GetBlockType(itr->m_RelX, itr->m_RelY - 1, itr->m_RelZ) == E_BLOCK_GRASS) + ) + { + a_ChunkDesc.SetBlockType(itr->m_RelX, itr->m_RelY - 1, itr->m_RelZ, E_BLOCK_DIRT); + } break; } -- cgit v1.2.3