From: Craig Robbins Date: Tue, 10 Mar 2015 08:46:28 +0000 (+1000) Subject: Ensure that heightmap is initialized before use X-Git-Tag: 0.4.13~506 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d4e210ee95430e6e8309e009fe7f0a70ca2dd606;p=oweals%2Fminetest.git Ensure that heightmap is initialized before use Without this, cavegen will use values in the heightmap before they are initialized. --- diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp index 7f5be27ae..d4b9201d9 100644 --- a/src/mapgen_v6.cpp +++ b/src/mapgen_v6.cpp @@ -56,6 +56,7 @@ 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;