diff options
author | Mattes D <github@xoft.cz> | 2014-05-12 08:51:07 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-12 08:51:07 +0200 |
commit | 702643d7e65d73a94b1ccfcdd21271f320a7e0a0 (patch) | |
tree | 0f1f08f4c0c0be97f42d793af85daec1bedf89a1 /src/Generating/StructGen.cpp | |
parent | Merge pull request #972 from mc-server/SslWebAdmin (diff) | |
parent | More switch warnings. (diff) | |
download | cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.gz cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.bz2 cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.lz cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.xz cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.zst cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.zip |
Diffstat (limited to 'src/Generating/StructGen.cpp')
-rw-r--r-- | src/Generating/StructGen.cpp | 28 |
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: |