1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +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
if(initialHero.getNum() >= -1)
if(initialHero.getNum() >= -1 || SEL->getPlayerInfo(color.getNum()).heroesNames.size() > 0)
allowedBonus.push_back(0); // artifact
allowedBonus.push_back(1); // gold
if(initialFaction.getNum() >= 0)
@ -922,7 +922,7 @@ void OptionsTab::SelectionWindow::setElement(int elem, bool doApply)
{
if(elem >= 4)
return;
set.bonus = static_cast<PlayerSettings::Ebonus>(elem-1);
set.bonus = static_cast<PlayerSettings::Ebonus>(allowedBonus[elem]);
if(set.bonus != PlayerSettings::NONE)
{
if(!doApply)