1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Works more or less

This commit is contained in:
Tomasz Zieliński
2023-10-28 20:30:38 +02:00
parent a817e481d0
commit 07dac8b6d4
7 changed files with 414 additions and 207 deletions

View File

@@ -332,7 +332,7 @@ void WindowNewMap::on_humanCombo_activated(int index)
ui->humanCombo->setCurrentIndex(humans);
}
mapGenOptions.setPlayerCount(humans);
mapGenOptions.setHumanOrCpuPlayerCount(humans);
int teams = mapGenOptions.getTeamCount();
if(teams > humans - 1)
@@ -361,8 +361,10 @@ void WindowNewMap::on_humanCombo_activated(int index)
void WindowNewMap::on_cpuCombo_activated(int index)
{
int humans = mapGenOptions.getPlayerCount();
int humans = mapGenOptions.getHumanOrCpuPlayerCount();
int cpu = ui->cpuCombo->currentData().toInt();
// FIXME: Use mapGenOption method only to calculate actual number of players for current template
if(cpu > PlayerColor::PLAYER_LIMIT_I - humans)
{
cpu = PlayerColor::PLAYER_LIMIT_I - humans;
@@ -455,7 +457,7 @@ void WindowNewMap::on_checkSeed_toggled(bool checked)
void WindowNewMap::on_humanTeamsCombo_activated(int index)
{
int humans = mapGenOptions.getPlayerCount();
int humans = mapGenOptions.getHumanOrCpuPlayerCount();
int teams = ui->humanTeamsCombo->currentData().toInt();
if(teams >= humans)
{