summaryrefslogtreecommitdiffstats
path: root/source/Generating/Caves.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-22 15:54:59 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-22 15:54:59 +0100
commit3f372ea4666aa178eb60f2b0c2ea16c1bcab96a7 (patch)
tree33b056dbece926da429ff9de3eda5da55b3ed314 /source/Generating/Caves.cpp
parentSimulator: fixed a problem when manipulating the bedrock layer (diff)
downloadcuberite-3f372ea4666aa178eb60f2b0c2ea16c1bcab96a7.tar
cuberite-3f372ea4666aa178eb60f2b0c2ea16c1bcab96a7.tar.gz
cuberite-3f372ea4666aa178eb60f2b0c2ea16c1bcab96a7.tar.bz2
cuberite-3f372ea4666aa178eb60f2b0c2ea16c1bcab96a7.tar.lz
cuberite-3f372ea4666aa178eb60f2b0c2ea16c1bcab96a7.tar.xz
cuberite-3f372ea4666aa178eb60f2b0c2ea16c1bcab96a7.tar.zst
cuberite-3f372ea4666aa178eb60f2b0c2ea16c1bcab96a7.zip
Diffstat (limited to '')
-rw-r--r--source/Generating/Caves.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/Generating/Caves.cpp b/source/Generating/Caves.cpp
index fdd6d4dce..39c207199 100644
--- a/source/Generating/Caves.cpp
+++ b/source/Generating/Caves.cpp
@@ -479,19 +479,19 @@ void cCaveTunnel::ProcessChunk(
continue;
}
- // Carve out a sphere around the xyz point, m_Radius in diameter:
+ // Carve out a sphere around the xyz point, m_Radius in diameter; skip 20 % off the top and bottom:
int DifX = itr->m_BlockX - BlockStartX; // substitution for faster calc
int DifY = itr->m_BlockY;
int DifZ = itr->m_BlockZ - BlockStartZ; // substitution for faster calc
- int Bottom = std::max(itr->m_BlockY - itr->m_Radius, 1);
- int Top = std::min(itr->m_BlockY + itr->m_Radius, (int)(cChunkDef::Height)); // Stupid gcc needs int cast
+ int Bottom = std::max(itr->m_BlockY - 4 * itr->m_Radius / 5, 1);
+ int Top = std::min(itr->m_BlockY + 4 * itr->m_Radius / 5, (int)(cChunkDef::Height));
int SqRad = itr->m_Radius * itr->m_Radius;
for (int z = 0; z < cChunkDef::Width; z++) for (int x = 0; x < cChunkDef::Width; x++)
{
for (int y = Bottom; y <= Top; y++)
{
int SqDist = (DifX - x) * (DifX - x) + (DifY - y) * (DifY - y) + (DifZ - z) * (DifZ - z);
- if (6 * SqDist <= SqRad)
+ if (SqDist <= SqRad)
{
switch (cChunkDef::GetBlock(a_BlockTypes, x, y, z))
{
@@ -722,7 +722,7 @@ int cStructGenWormNestCaves::cCaveSystem::GetRadius(cNoise & a_Noise, int a_Orig
*/
// The algorithm of choice: Divide a constant by the random number returned, thus producing a hyperbole-shaped noise distribution
- int res = 4 + (32 / ((rnd & 0xff) + 2));
+ int res = 2 + (32 / ((rnd & 0xff) + 2));
return res;
}