From c921f47d85bf09e1d07562dc9763bd7b71875bbe Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Sat, 16 Apr 2016 21:50:13 +0300 Subject: Prevented snow from killing grass --- src/Blocks/BlockDirt.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Blocks/BlockDirt.h b/src/Blocks/BlockDirt.h index a06d9d030..33325d53a 100644 --- a/src/Blocks/BlockDirt.h +++ b/src/Blocks/BlockDirt.h @@ -51,8 +51,10 @@ public: { BLOCKTYPE above = a_Chunk.GetBlock(a_RelX, a_RelY + 1, a_RelZ); - // Grass turns back to dirt when the block above it is not transparent or water - if (!cBlockInfo::IsTransparent(above) || IsBlockWater(above)) + // Grass turns back to dirt when the block above it is not transparent or water. + // It does not turn to dirt when a snow layer is above. + if ((above != E_BLOCK_SNOW) && + (!cBlockInfo::IsTransparent(above) || IsBlockWater(above))) { a_Chunk.FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL); return; -- cgit v1.2.3