From 3f372ea4666aa178eb60f2b0c2ea16c1bcab96a7 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 22 Mar 2013 14:54:59 +0000 Subject: WormNestCaves: tweaked a bit not to produce the single-block holes in the floor git-svn-id: http://mc-server.googlecode.com/svn/trunk@1296 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/Caves.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/Generating') 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; } -- cgit v1.2.3