Sfoglia il codice sorgente

- Missing thing to previous commit...

beegee1 12 anni fa
parent
commit
fd9995ff82
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      lib/rmg/CMapGenerator.cpp

+ 3 - 2
lib/rmg/CMapGenerator.cpp

@@ -22,7 +22,7 @@
 #include "../StringConstants.h"
 #include "CRmgTemplate.h"
 
-CMapGenerator::CMapGenerator()
+CMapGenerator::CMapGenerator() : mapGenOptions(nullptr), randomSeed(0)
 {
 
 }
@@ -34,7 +34,8 @@ CMapGenerator::~CMapGenerator()
 
 std::unique_ptr<CMap> CMapGenerator::generate(CMapGenOptions * mapGenOptions, int randomSeed /*= std::time(nullptr)*/)
 {
-	gen.seed(randomSeed);
+	this->randomSeed = randomSeed;
+	gen.seed(this->randomSeed);
 	this->mapGenOptions = mapGenOptions;
 	this->mapGenOptions->finalize(gen);