diff options
author | kwolekr <kwolekr@minetest.net> | 2015-01-15 12:46:42 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-01-15 16:23:04 -0500 |
commit | 0330cec7ec55126c9cc441373cde1253bed895ee (patch) | |
tree | f92fcbedf46df892b3a6cb85e0f8dcf22230b051 /src | |
parent | 77e20a0c2188ab260e571a0406959113faa3e850 (diff) | |
download | minetest-0330cec7ec55126c9cc441373cde1253bed895ee.tar.gz minetest-0330cec7ec55126c9cc441373cde1253bed895ee.tar.bz2 minetest-0330cec7ec55126c9cc441373cde1253bed895ee.zip |
Initialize noise ptr on creation (fixes crash if OreVein deleted before use)
Diffstat (limited to 'src')
-rw-r--r-- | src/mg_ore.cpp | 6 | ||||
-rw-r--r-- | src/mg_ore.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/mg_ore.cpp b/src/mg_ore.cpp index dfcb1a1d9..c62f05860 100644 --- a/src/mg_ore.cpp +++ b/src/mg_ore.cpp @@ -263,6 +263,12 @@ void OreBlob::generate(MMVManip *vm, int mapseed, u32 blockseed, /////////////////////////////////////////////////////////////////////////////// +OreVein::OreVein() +{ + noise2 = NULL; +} + + OreVein::~OreVein() { delete noise2; diff --git a/src/mg_ore.h b/src/mg_ore.h index ea713cfcc..67ca9a849 100644 --- a/src/mg_ore.h +++ b/src/mg_ore.h @@ -105,6 +105,7 @@ public: float random_factor; Noise *noise2; + OreVein(); virtual ~OreVein(); virtual void generate(MMVManip *vm, int mapseed, u32 blockseed, |