summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-27 18:46:15 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-27 18:46:15 +0200
commita68b9bd986f557c79822d5ba61333747dd11bd80 (patch)
tree7999ce9367966bdbf5db51b326ccccac04b482e6
parentAdded a new cave generator: DualRidgeCaves ( somewhat like http://www.gamedev.net/blog/33/entry-2227887-more-on-minecraft-type-world-gen/ ) (diff)
downloadcuberite-a68b9bd986f557c79822d5ba61333747dd11bd80.tar
cuberite-a68b9bd986f557c79822d5ba61333747dd11bd80.tar.gz
cuberite-a68b9bd986f557c79822d5ba61333747dd11bd80.tar.bz2
cuberite-a68b9bd986f557c79822d5ba61333747dd11bd80.tar.lz
cuberite-a68b9bd986f557c79822d5ba61333747dd11bd80.tar.xz
cuberite-a68b9bd986f557c79822d5ba61333747dd11bd80.tar.zst
cuberite-a68b9bd986f557c79822d5ba61333747dd11bd80.zip
Diffstat (limited to '')
-rw-r--r--source/Ravines.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/Ravines.cpp b/source/Ravines.cpp
index 726f3ffb4..cee1192d6 100644
--- a/source/Ravines.cpp
+++ b/source/Ravines.cpp
@@ -315,7 +315,7 @@ void cStructGenRavines::cRavine::Smooth(void)
void cStructGenRavines::cRavine::FinishLinear(void)
{
- // For each segment, use Bresenham's algorithm to draw a "line" of defpoints
+ // For each segment, use Bresenham's line algorithm to draw a "line" of defpoints
// _X 2012_07_20: I tried modifying this algorithm to produce "thick" lines (only one coord change per point)
// But the results were about the same as the original, so I disposed of it again - no need to use twice the count of points
@@ -450,8 +450,8 @@ void cStructGenRavines::cRavine::ProcessChunk(
int DistSq = (DifX + x) * (DifX + x) + (DifZ + z) * (DifZ + z);
if (DistSq <= RadiusSq)
{
- int Top = itr->m_Top;
- for (int y = itr->m_Bottom; y <= Top; y++)
+ int Top = std::min(itr->m_Top, cChunkDef::Height);
+ for (int y = std::max(itr->m_Bottom, 1); y <= Top; y++)
{
cChunkDef::SetBlock(a_BlockTypes, x, y, z, E_BLOCK_AIR);
}