1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00
This commit is contained in:
Michael 2023-08-12 20:31:00 +02:00 committed by GitHub
parent 3d08ecf024
commit 18b963f376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -433,8 +433,8 @@ OptionsTab::SelectionWindow::SelectionWindow(PlayerColor _color)
initialHero = SEL->getStartInfo()->playerInfos.find(color)->second.hero;
initialBonus = SEL->getStartInfo()->playerInfos.find(color)->second.bonus;
selectedFraction = initialFraction;
selectedHero = selectedHero;
selectedBonus = selectedBonus;
selectedHero = initialHero;
selectedBonus = initialBonus;
allowedFactions = SEL->getPlayerInfo(color.getNum()).allowedFactions;
allowedHeroes = SEL->getMapInfo()->mapHeader->allowedHeroes;
@ -491,14 +491,14 @@ void OptionsTab::SelectionWindow::setSelection()
CSH->setPlayerOption(LobbyChangePlayerOption::HERO, deltaHero > 0 ? 1 : -1, color);
// bonus
//int deltaBonus = selectedBonus - initialBonus;
int deltaBonus = selectedBonus - initialBonus;
//if(deltaBonus != 0)
// for(int i = 0; i<abs(deltaBonus); i++)
// CSH->setPlayerOption(LobbyChangePlayerOption::BONUS, deltaBonus > 0 ? 1 : -1, color);
if(deltaBonus != 0)
for(int i = 0; i<abs(deltaBonus); i++)
CSH->setPlayerOption(LobbyChangePlayerOption::BONUS, deltaBonus > 0 ? 1 : -1, color);
}
void OptionsTab::SelectionWindow::redraw()
void OptionsTab::SelectionWindow::recreate()
{
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;