1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

More rollback.

This commit is contained in:
DjWarmonger 2014-05-23 13:23:03 +02:00
parent 5b0b152aa3
commit 342aec0700
3 changed files with 5 additions and 5 deletions

View File

@ -841,7 +841,7 @@ void CGameState::initNewGame()
// Gen map
CMapGenerator mapGenerator(scenarioOps->mapGenOptions, scenarioOps->seedToBeUsed);
map = mapGenerator.generate();
map = mapGenerator.generate().release();
// Update starting options
for(int i = 0; i < map->players.size(); ++i)

View File

@ -24,11 +24,11 @@ CMapGenerator::~CMapGenerator()
}
ConstTransitivePtr<CMap> CMapGenerator::generate()
std::unique_ptr<CMap> CMapGenerator::generate()
{
mapGenOptions->finalize(rand);
//map = make_unique<CMap>();
map = make_unique<CMap>();
editManager = map->getEditManager();
editManager->getUndoManager().setUndoRedoLimit(0);
addHeaderInfo();

View File

@ -36,10 +36,10 @@ public:
explicit CMapGenerator(shared_ptr<CMapGenOptions> mapGenOptions, int randomSeed = std::time(nullptr));
~CMapGenerator(); // required due to unique_ptr
ConstTransitivePtr<CMap> generate();
std::unique_ptr<CMap> generate();
shared_ptr<CMapGenOptions> mapGenOptions;
ConstTransitivePtr<CMap> map;
std::unique_ptr<CMap> map;
CRandomGenerator rand;
int randomSeed;
CMapEditManager * editManager;