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:
@ -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();
|
||||
|
Reference in New Issue
Block a user