Michael 2 years ago
parent
commit
18b963f376
1 changed files with 7 additions and 7 deletions
  1. 7 7
      client/lobby/OptionsTab.cpp

+ 7 - 7
client/lobby/OptionsTab.cpp

@@ -433,8 +433,8 @@ OptionsTab::SelectionWindow::SelectionWindow(PlayerColor _color)
 	initialHero = SEL->getStartInfo()->playerInfos.find(color)->second.hero;
 	initialHero = SEL->getStartInfo()->playerInfos.find(color)->second.hero;
 	initialBonus = SEL->getStartInfo()->playerInfos.find(color)->second.bonus;
 	initialBonus = SEL->getStartInfo()->playerInfos.find(color)->second.bonus;
 	selectedFraction = initialFraction;
 	selectedFraction = initialFraction;
-	selectedHero = selectedHero;
-	selectedBonus = selectedBonus;
+	selectedHero = initialHero;
+	selectedBonus = initialBonus;
 	allowedFactions = SEL->getPlayerInfo(color.getNum()).allowedFactions;
 	allowedFactions = SEL->getPlayerInfo(color.getNum()).allowedFactions;
 	allowedHeroes = SEL->getMapInfo()->mapHeader->allowedHeroes;
 	allowedHeroes = SEL->getMapInfo()->mapHeader->allowedHeroes;
 
 
@@ -491,14 +491,14 @@ void OptionsTab::SelectionWindow::setSelection()
 			CSH->setPlayerOption(LobbyChangePlayerOption::HERO, deltaHero > 0 ? 1 : -1, color);
 			CSH->setPlayerOption(LobbyChangePlayerOption::HERO, deltaHero > 0 ? 1 : -1, color);
 
 
 	// bonus
 	// 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;
 	OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;