Initialize noise ptr on creation (fixes crash if OreVein deleted before use)
authorkwolekr <kwolekr@minetest.net>
Thu, 15 Jan 2015 17:46:42 +0000 (12:46 -0500)
committerkwolekr <kwolekr@minetest.net>
Thu, 15 Jan 2015 21:23:04 +0000 (16:23 -0500)
src/mg_ore.cpp
src/mg_ore.h

index dfcb1a1d9f6d31338aedb835a35819afea07e703..c62f05860edb72078c98bfcb2e88630d75b2df9c 100644 (file)
@@ -263,6 +263,12 @@ void OreBlob::generate(MMVManip *vm, int mapseed, u32 blockseed,
 
 ///////////////////////////////////////////////////////////////////////////////
 
+OreVein::OreVein()
+{
+       noise2 = NULL;
+}
+
+
 OreVein::~OreVein()
 {
        delete noise2;
index ea713cfcc70de65212ca18356c18e4c5dd3686e0..67ca9a849630f03d1ad5801ab157ecf4e10874e1 100644 (file)
@@ -105,6 +105,7 @@ public:
        float random_factor;
        Noise *noise2;
 
+       OreVein();
        virtual ~OreVein();
 
        virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,