mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
More rollback.
This commit is contained in:
parent
5b0b152aa3
commit
342aec0700
@ -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)
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user