summaryrefslogtreecommitdiff
path: root/src/mapgen_v6.cpp
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2015-03-11 05:28:07 +0000
committerparamat <mat.gregory@virginmedia.com>2015-03-11 06:04:07 +0000
commit29e46d6b29a50151785cd96f70eed957e2b075f3 (patch)
treec1f338d6ebafffb285b35ee395955684dd334e84 /src/mapgen_v6.cpp
parentb2b6bbf3e80f0ab06d62c43567122871ae560534 (diff)
downloadminetest-29e46d6b29a50151785cd96f70eed957e2b075f3.tar.gz
minetest-29e46d6b29a50151785cd96f70eed957e2b075f3.tar.bz2
minetest-29e46d6b29a50151785cd96f70eed957e2b075f3.zip
Mgv6: Fix uninitialised heightmap used by cavegen
Diffstat (limited to 'src/mapgen_v6.cpp')
-rw-r--r--src/mapgen_v6.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp
index d4b9201d9..fcf59562f 100644
--- a/src/mapgen_v6.cpp
+++ b/src/mapgen_v6.cpp
@@ -56,7 +56,6 @@ MapgenV6::MapgenV6(int mapgenid, MapgenParams *params, EmergeManager *emerge)
this->ystride = csize.X; //////fix this
this->heightmap = new s16[csize.X * csize.Z];
- memset(this->heightmap, 0, csize.X * csize.Z * sizeof(*this->heightmap));
MapgenV6Params *sp = (MapgenV6Params *)params->sparams;
this->spflags = sp->spflags;
@@ -480,6 +479,9 @@ void MapgenV6::makeChunk(BlockMakeData *data)
generateExperimental();
+ // Create initial heightmap to limit caves
+ updateHeightmap(node_min, node_max);
+
const s16 max_spread_amount = MAP_BLOCKSIZE;
// Limit dirt flow area by 1 because mud is flown into neighbors.
s16 mudflow_minpos = -max_spread_amount + 1;
@@ -504,7 +506,7 @@ void MapgenV6::makeChunk(BlockMakeData *data)
}
- // Create heightmap after mudflow
+ // Update heightmap after mudflow
updateHeightmap(node_min, node_max);
// Add dungeons