浏览代码

- Missing thing to previous commit...

beegee1 12 年之前
父节点
当前提交
fd9995ff82
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lib/rmg/CMapGenerator.cpp

+ 3 - 2
lib/rmg/CMapGenerator.cpp

@@ -22,7 +22,7 @@
 #include "../StringConstants.h"
 #include "../StringConstants.h"
 #include "CRmgTemplate.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)*/)
 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 = mapGenOptions;
 	this->mapGenOptions->finalize(gen);
 	this->mapGenOptions->finalize(gen);