summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorarchshift <admin@archshft.com>2014-05-12 01:25:21 +0200
committerarchshift <admin@archshift.com>2014-05-12 01:28:48 +0200
commit3f9e00a3f3486c2845115e495d66f438f90825f3 (patch)
treef1ca0c7917206b47998ca6ee143fbbcbb3e50bf1 /src/Generating
parentFixed a warning and a complaint about a never-read variable. (diff)
downloadcuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.gz
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.bz2
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.lz
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.xz
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.zst
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.zip
Diffstat (limited to 'src/Generating')
-rw-r--r--src/Generating/StructGen.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp
index db9d5578c..636364e17 100644
--- a/src/Generating/StructGen.cpp
+++ b/src/Generating/StructGen.cpp
@@ -596,24 +596,22 @@ void cStructGenDirectOverhangs::GenFinish(cChunkDesc & a_ChunkDesc)
// Interpolate between FloorLo and FloorHi:
for (int z = 0; z < 16; z++) for (int x = 0; x < 16; x++)
{
- switch (a_ChunkDesc.GetBiome(x, z))
+ EMCSBiome biome = a_ChunkDesc.GetBiome(x, z);
+
+ if ((biome == biExtremeHills) || (biome == biExtremeHillsEdge))
{
- case biExtremeHills:
- case biExtremeHillsEdge:
+ int Lo = FloorLo[x + 17 * z] / 256;
+ int Hi = FloorHi[x + 17 * z] / 256;
+ for (int y = 0; y < SEGMENT_HEIGHT; y++)
{
- int Lo = FloorLo[x + 17 * z] / 256;
- int Hi = FloorHi[x + 17 * z] / 256;
- for (int y = 0; y < SEGMENT_HEIGHT; y++)
+ int Val = Lo + (Hi - Lo) * y / SEGMENT_HEIGHT;
+ if (Val < 0)
{
- int Val = Lo + (Hi - Lo) * y / SEGMENT_HEIGHT;
- if (Val < 0)
- {
- a_ChunkDesc.SetBlockType(x, y + Segment, z, E_BLOCK_AIR);
- }
- } // for y
- break;
- }
- } // switch (biome)
+ a_ChunkDesc.SetBlockType(x, y + Segment, z, E_BLOCK_AIR);
+ }
+ } // for y
+ break;
+ } // if (biome)
} // for z, x
// Swap the floors: