Skip to content

Commit

Permalink
Ensure that heightmap is initialized before use
Browse files Browse the repository at this point in the history
Without this, cavegen will use values in the heightmap before they are initialized.
  • Loading branch information
Zeno- committed Mar 10, 2015
1 parent e74b8da commit d4e210e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mapgen_v6.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit d4e210e

Please sign in to comment.