summaryrefslogtreecommitdiffstats
path: root/src/Generating/FinishGen.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2015-02-25 19:22:44 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2015-02-25 19:22:44 +0100
commitac2c88b4510c8504cf015bfa69fc844aa9293e34 (patch)
tree0eca60f66e44154fcd7dea60b6467415427d894c /src/Generating/FinishGen.cpp
parentSnow finisher uses GetSnowStartHeight instead of specific biomes (diff)
downloadcuberite-ac2c88b4510c8504cf015bfa69fc844aa9293e34.tar
cuberite-ac2c88b4510c8504cf015bfa69fc844aa9293e34.tar.gz
cuberite-ac2c88b4510c8504cf015bfa69fc844aa9293e34.tar.bz2
cuberite-ac2c88b4510c8504cf015bfa69fc844aa9293e34.tar.lz
cuberite-ac2c88b4510c8504cf015bfa69fc844aa9293e34.tar.xz
cuberite-ac2c88b4510c8504cf015bfa69fc844aa9293e34.tar.zst
cuberite-ac2c88b4510c8504cf015bfa69fc844aa9293e34.zip
Diffstat (limited to 'src/Generating/FinishGen.cpp')
-rw-r--r--src/Generating/FinishGen.cpp45
1 files changed, 19 insertions, 26 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 548c50563..d8fb9c8c0 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -503,34 +503,27 @@ void cFinishGenIce::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);
- switch (a_ChunkDesc.GetBlockType(x, Height, z))
- {
- case E_BLOCK_WATER:
- case E_BLOCK_STATIONARY_WATER:
- {
- a_ChunkDesc.SetBlockType(x, Height, z, E_BLOCK_ICE);
- break;
- }
- }
- break;
- }
- default:
- {
- // No icy water in other biomes.
- break;
- }
+ // Height isn't high enough for snow to start forming.
+ continue;
}
- }
+
+ if (!IsBlockWater(a_ChunkDesc.GetBlockType(x, Height, z)))
+ {
+ // The block isn't a water block.
+ continue;
+ }
+
+ if (a_ChunkDesc.GetBlockMeta(x, Height, z) != 0)
+ {
+ // The water block isn't a source block.
+ continue;
+ }
+
+ a_ChunkDesc.SetBlockType(x, Height, z, E_BLOCK_ICE);
+ } // for x
} // for z
}