1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

- Fixed some bugs when starting a RMG map - Checks if there is a template for the chosen options(rejects if not) - Added a few templates for development(2 to 4 players, medium maps are supported) - Refactoring

This commit is contained in:
beegee1
2013-05-21 19:08:06 +00:00
parent c920f29c45
commit 5328beb8e7
10 changed files with 976 additions and 720 deletions

View File

@ -862,22 +862,11 @@ void CGameState::init(StartInfo * si)
{
case StartInfo::NEW_GAME:
{
if(scenarioOps->createRandomMap)
if(scenarioOps->createRandomMap())
{
logGlobal->infoStream() << "Create random map.";
CStopWatch sw;
// Create player settings for RMG
BOOST_FOREACH(const auto & pair, scenarioOps->playerInfos)
{
const auto & playerSettings = pair.second;
scenarioOps->mapGenOptions->setStartingTownForPlayer(playerSettings.color, playerSettings.castle);
if(playerSettings.playerID > 0)
{
scenarioOps->mapGenOptions->setPlayerTypeForStandardPlayer(playerSettings.color, EPlayerType::HUMAN);
}
}
// Gen map
CMapGenerator mapGen(*(scenarioOps->mapGenOptions), scenarioOps->seedToBeUsed);
map = mapGen.generate().release();