Skip to content

Commit d4e210e

Browse files
committedMar 10, 2015
Ensure that heightmap is initialized before use
Without this, cavegen will use values in the heightmap before they are initialized.
1 parent e74b8da commit d4e210e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

Diff for: ‎src/mapgen_v6.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ MapgenV6::MapgenV6(int mapgenid, MapgenParams *params, EmergeManager *emerge)
5656
this->ystride = csize.X; //////fix this
5757

5858
this->heightmap = new s16[csize.X * csize.Z];
59+
memset(this->heightmap, 0, csize.X * csize.Z * sizeof(*this->heightmap));
5960

6061
MapgenV6Params *sp = (MapgenV6Params *)params->sparams;
6162
this->spflags = sp->spflags;

0 commit comments

Comments
 (0)
Please sign in to comment.