1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Fixed Scholar handling

This commit is contained in:
Ivan Savenko
2023-10-18 17:14:22 +03:00
parent 48eba6c362
commit ce480c8c84
5 changed files with 87 additions and 29 deletions

View File

@ -55,12 +55,18 @@ std::vector<Component> CRewardableObject::loadComponents(const CGHeroInstance *
{
std::vector<Component> result;
if (rewardIndices.size() > 1)
if (rewardIndices.empty())
return result;
if (configuration.selectMode != Rewardable::SELECT_FIRST)
{
for (auto index : rewardIndices)
result.push_back(configuration.info.at(index).reward.getDisplayedComponent(contextHero));
if (rewardIndices.size() == 1)
}
else
{
configuration.info.at(rewardIndices.front()).reward.loadComponents(result, contextHero);
}
return result;
}