1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fix treasure chests

This commit is contained in:
Ivan Savenko
2023-10-19 15:41:41 +03:00
parent 8f4791914e
commit 01920bb74e
2 changed files with 6 additions and 6 deletions

View File

@@ -58,9 +58,6 @@ std::vector<Component> CRewardableObject::loadComponents(const CGHeroInstance *
if (rewardIndices.empty())
return result;
if (!configuration.showScoutedPreview)
return result;
if (configuration.selectMode != Rewardable::SELECT_FIRST)
{
for (auto index : rewardIndices)
@@ -317,6 +314,9 @@ std::vector<Component> CRewardableObject::getPopupComponentsImpl(PlayerColor pla
if (!wasScouted(player))
return {};
if (!configuration.showScoutedPreview)
return {};
auto rewardIndices = getAvailableRewards(hero, Rewardable::EEventType::EVENT_FIRST_VISIT);
if (rewardIndices.empty() && !configuration.info.empty())
rewardIndices.push_back(0);