1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix crash on visiting Seer Hut with no reward

This commit is contained in:
Ivan Savenko 2023-12-10 19:48:44 +02:00
parent b62e801530
commit 7187ba2d79

View File

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