From 0330cec7ec55126c9cc441373cde1253bed895ee Mon Sep 17 00:00:00 2001 From: kwolekr Date: Thu, 15 Jan 2015 12:46:42 -0500 Subject: [PATCH] Initialize noise ptr on creation (fixes crash if OreVein deleted before use) --- src/mg_ore.cpp | 6 ++++++ src/mg_ore.h | 1 + 2 files changed, 7 insertions(+) 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, -- 2.25.1