diff options
author | Mattes D <github@xoft.cz> | 2016-12-01 22:17:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 22:17:18 +0100 |
commit | 27718cca45b26e66867fac2238ae81381c672a96 (patch) | |
tree | 33615f07c5a1f7043962cd56c2f09c497a4b2213 /src/Generating | |
parent | Merge pull request #3469 from QuImUfu/patch-1 (diff) | |
parent | Fixed villages generating under-water. (diff) | |
download | cuberite-27718cca45b26e66867fac2238ae81381c672a96.tar cuberite-27718cca45b26e66867fac2238ae81381c672a96.tar.gz cuberite-27718cca45b26e66867fac2238ae81381c672a96.tar.bz2 cuberite-27718cca45b26e66867fac2238ae81381c672a96.tar.lz cuberite-27718cca45b26e66867fac2238ae81381c672a96.tar.xz cuberite-27718cca45b26e66867fac2238ae81381c672a96.tar.zst cuberite-27718cca45b26e66867fac2238ae81381c672a96.zip |
Diffstat (limited to 'src/Generating')
-rw-r--r-- | src/Generating/CompoGenBiomal.cpp | 7 | ||||
-rw-r--r-- | src/Generating/VillageGen.cpp | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/Generating/CompoGenBiomal.cpp b/src/Generating/CompoGenBiomal.cpp index 0606477a1..c8e56da7d 100644 --- a/src/Generating/CompoGenBiomal.cpp +++ b/src/Generating/CompoGenBiomal.cpp @@ -435,7 +435,12 @@ protected: { bool HasHadWater = false; int PatternIdx = 0; - HEIGHTTYPE top = std::max(m_SeaLevel, a_ChunkDesc.GetHeight(a_RelX, a_RelZ)); + HEIGHTTYPE top = a_ChunkDesc.GetHeight(a_RelX, a_RelZ); + if (top < m_SeaLevel) + { + top = m_SeaLevel; + a_ChunkDesc.SetHeight(a_RelX, a_RelZ, top - 1); + } for (int y = top; y > 0; y--) { if (a_ShapeColumn[y] > 0) diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index e0804625a..ccea3338d 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -234,13 +234,14 @@ protected: { for (int x = MinX; x <= MaxX; x++) { - if (IsBlockWater(a_Chunk.GetBlockType(x, cChunkDef::GetHeight(a_HeightMap, x, z), z))) + auto height = cChunkDef::GetHeight(a_HeightMap, x, z); + if (IsBlockWater(a_Chunk.GetBlockType(x, height, z))) { - a_Chunk.SetBlockTypeMeta(x, cChunkDef::GetHeight(a_HeightMap, x, z), z, WaterRoadBlockType, WaterRoadBlockMeta); + a_Chunk.SetBlockTypeMeta(x, height, z, WaterRoadBlockType, WaterRoadBlockMeta); } else { - a_Chunk.SetBlockTypeMeta(x, cChunkDef::GetHeight(a_HeightMap, x, z), z, RoadBlockType, RoadBlockMeta); + a_Chunk.SetBlockTypeMeta(x, height, z, RoadBlockType, RoadBlockMeta); } } } |