1
0
Fork 0

Initialize noise ptr on creation (fixes crash if OreVein deleted before use)

mutilcraft-mt53
kwolekr 2015-01-15 12:46:42 -05:00
parent 77e20a0c21
commit 0330cec7ec
2 changed files with 7 additions and 0 deletions

View File

@ -263,6 +263,12 @@ void OreBlob::generate(MMVManip *vm, int mapseed, u32 blockseed,
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
OreVein::OreVein()
{
noise2 = NULL;
}
OreVein::~OreVein() OreVein::~OreVein()
{ {
delete noise2; delete noise2;

View File

@ -105,6 +105,7 @@ public:
float random_factor; float random_factor;
Noise *noise2; Noise *noise2;
OreVein();
virtual ~OreVein(); virtual ~OreVein();
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed, virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,