mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix #3234
This commit is contained in:
parent
0b7edd471c
commit
625c18a889
@ -107,6 +107,10 @@ RandomMapTab::RandomMapTab()
|
||||
groupCompOnlyPlayers->addCallback([&](int btnId)
|
||||
{
|
||||
mapGenOptions->setCompOnlyPlayerCount(btnId);
|
||||
|
||||
// deactive some MaxPlayers buttons to prevent total number of players exceeds PlayerColor::PLAYER_LIMIT_I
|
||||
deactivateButtonsFrom(groupMaxPlayers.get(), PlayerColor::PLAYER_LIMIT_I - btnId + 1);
|
||||
|
||||
deactivateButtonsFrom(groupCompOnlyTeams.get(), (btnId == 0 ? 1 : btnId));
|
||||
validateCompOnlyPlayersCnt(btnId);
|
||||
updateMapInfoByHost();
|
||||
|
@ -70,7 +70,7 @@ void CMapGenOptions::setPlayerCount(si8 value)
|
||||
assert((value >= 1 && value <= PlayerColor::PLAYER_LIMIT_I) || value == RANDOM_SIZE);
|
||||
playerCount = value;
|
||||
|
||||
auto possibleCompPlayersCount = value;
|
||||
auto possibleCompPlayersCount = PlayerColor::PLAYER_LIMIT_I - value;
|
||||
if (compOnlyPlayerCount > possibleCompPlayersCount)
|
||||
setCompOnlyPlayerCount(possibleCompPlayersCount);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user