projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e74b8da
)
Ensure that heightmap is initialized before use
author
Craig Robbins
<kde.psych@gmail.com>
Tue, 10 Mar 2015 08:46:28 +0000
(18:46 +1000)
committer
Craig Robbins
<kde.psych@gmail.com>
Tue, 10 Mar 2015 08:46:28 +0000
(18:46 +1000)
Without this, cavegen will use values in the heightmap before they are initialized.
src/mapgen_v6.cpp
patch
|
blob
|
history
diff --git
a/src/mapgen_v6.cpp
b/src/mapgen_v6.cpp
index 7f5be27ae83ad4b7d7597364f289337188804c06..d4b9201d936e51681338c72ab6b833816c850f02 100644
(file)
--- 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;