summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2015-02-25 19:12:53 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2015-02-25 19:12:53 +0100
commitba3eaf922377c4b19d66b205a47c0698ea02f5b4 (patch)
tree92b45db01826106fc53bebd496b17125470b58dd /src/Generating
parentWeather: Snow starts forming when the top block is at the right height or higher (diff)
downloadcuberite-ba3eaf922377c4b19d66b205a47c0698ea02f5b4.tar
cuberite-ba3eaf922377c4b19d66b205a47c0698ea02f5b4.tar.gz
cuberite-ba3eaf922377c4b19d66b205a47c0698ea02f5b4.tar.bz2
cuberite-ba3eaf922377c4b19d66b205a47c0698ea02f5b4.tar.lz
cuberite-ba3eaf922377c4b19d66b205a47c0698ea02f5b4.tar.xz
cuberite-ba3eaf922377c4b19d66b205a47c0698ea02f5b4.tar.zst
cuberite-ba3eaf922377c4b19d66b205a47c0698ea02f5b4.zip
Diffstat (limited to 'src/Generating')
-rw-r--r--src/Generating/FinishGen.cpp36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index e10cb00f8..548c50563 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -470,30 +470,22 @@ void cFinishGenSnow::GenFinish(cChunkDesc & a_ChunkDesc)
{
for (int x = 0; x < cChunkDef::Width; x++)
{
- switch (a_ChunkDesc.GetBiome(x, z))
+ int Height = a_ChunkDesc.GetHeight(x, z);
+ if (GetSnowStartHeight(a_ChunkDesc.GetBiome(x, z)) > Height)
{
- case biIcePlains:
- case biIceMountains:
- case biTaiga:
- case biTaigaHills:
- case biFrozenRiver:
- case biFrozenOcean:
- {
- int Height = a_ChunkDesc.GetHeight(x, z);
- if (cBlockInfo::IsSnowable(a_ChunkDesc.GetBlockType(x, Height, z)) && (Height < cChunkDef::Height - 1))
- {
- a_ChunkDesc.SetBlockType(x, Height + 1, z, E_BLOCK_SNOW);
- a_ChunkDesc.SetHeight(x, z, Height + 1);
- }
- break;
- }
- default:
- {
- // There's no snow in the other biomes.
- break;
- }
+ // Height isn't high enough for snow to start forming.
+ continue;
}
- }
+
+ if (!cBlockInfo::IsSnowable(a_ChunkDesc.GetBlockType(x, Height, z)) && (Height < cChunkDef::Height - 1))
+ {
+ // The top block can't be snown over.
+ continue;
+ }
+
+ a_ChunkDesc.SetBlockType(x, Height + 1, z, E_BLOCK_SNOW);
+ a_ChunkDesc.SetHeight(x, z, Height + 1);
+ } // for x
} // for z
}