From 70b0547499c4343e3071a54e3c093712669a3a8f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 15 May 2014 16:03:45 +0200 Subject: Fixed a NULL ptr failure in GridStructGen. When the descendant generator returned a NULL structure, the generator would crash. Now it uses a special cEmptyStructure class instead. --- src/Generating/GridStructGen.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Generating/GridStructGen.h') diff --git a/src/Generating/GridStructGen.h b/src/Generating/GridStructGen.h index 234cc75c5..630a5e44e 100644 --- a/src/Generating/GridStructGen.h +++ b/src/Generating/GridStructGen.h @@ -39,14 +39,6 @@ class cGridStructGen : public cFinishGen { public: - cGridStructGen( - int a_Seed, - int a_GridSizeX, int a_GridSizeZ, - int a_MaxStructureSizeX, int a_MaxStructureSizeZ, - size_t a_MaxCacheSize - ); - -protected: /** Represents a single structure that occupies the grid point. Knows how to draw itself into a chunk. */ class cStructure { @@ -75,6 +67,14 @@ protected: typedef std::list cStructurePtrs; + cGridStructGen( + int a_Seed, + int a_GridSizeX, int a_GridSizeZ, + int a_MaxStructureSizeX, int a_MaxStructureSizeZ, + size_t a_MaxCacheSize + ); + +protected: /** Seed for generating the semi-random grid. */ int m_Seed; -- cgit v1.2.3