1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-15 11:46:56 +02:00

Merge pull request #2872 from Laserlicht/bonus_selection

fix bonus selection
This commit is contained in:
Ivan Savenko 2023-09-20 13:19:54 +03:00 committed by GitHub
commit 00db2e245f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -625,7 +625,7 @@ OptionsTab::SelectionWindow::SelectionWindow(PlayerColor _color, SelType _type)
} }
allowedBonus.push_back(-1); // random allowedBonus.push_back(-1); // random
if(initialHero.getNum() >= -1) if(initialHero.getNum() >= -1 || SEL->getPlayerInfo(color.getNum()).heroesNames.size() > 0)
allowedBonus.push_back(0); // artifact allowedBonus.push_back(0); // artifact
allowedBonus.push_back(1); // gold allowedBonus.push_back(1); // gold
if(initialFaction.getNum() >= 0) if(initialFaction.getNum() >= 0)
@ -922,7 +922,7 @@ void OptionsTab::SelectionWindow::setElement(int elem, bool doApply)
{ {
if(elem >= 4) if(elem >= 4)
return; return;
set.bonus = static_cast<PlayerSettings::Ebonus>(elem-1); set.bonus = static_cast<PlayerSettings::Ebonus>(allowedBonus[elem]);
if(set.bonus != PlayerSettings::NONE) if(set.bonus != PlayerSettings::NONE)
{ {
if(!doApply) if(!doApply)