1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Fix teams

This commit is contained in:
nordsoft 2022-12-14 05:45:50 +04:00
parent fc7f1dbc5a
commit 4c3288dd61

View File

@ -188,8 +188,11 @@ void RandomMapTab::setMapGenOptions(std::shared_ptr<CMapGenOptions> opts)
});
vstd::erase_if(playerTeamsAllowed,
[opts](int el){
return PlayerColor::PLAYER_LIMIT_I - opts->getPlayerCount() < el + 1;
return opts->getPlayerCount() <= el;
});
if(!playerTeamsAllowed.count(opts->getTeamCount()))
opts->setTeamCount(CMapGenOptions::RANDOM_SIZE);
}
if(mapGenOptions->getCompOnlyPlayerCount() != CMapGenOptions::RANDOM_SIZE)
{
@ -199,8 +202,11 @@ void RandomMapTab::setMapGenOptions(std::shared_ptr<CMapGenOptions> opts)
});
vstd::erase_if(compTeamsAllowed,
[opts](int el){
return PlayerColor::PLAYER_LIMIT_I - opts->getCompOnlyPlayerCount() < el + 1;
return opts->getCompOnlyPlayerCount() <= el;
});
if(!compTeamsAllowed.count(opts->getCompOnlyTeamCount()))
opts->setCompOnlyTeamCount(CMapGenOptions::RANDOM_SIZE);
}
if(auto w = widget<CToggleGroup>("groupMapSize"))