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

Implement select all option for rewardable objects

This commit is contained in:
nordsoft
2023-09-15 21:08:14 +02:00
parent c1c13cfafb
commit 68c61797f8
3 changed files with 41 additions and 5 deletions

View File

@@ -108,6 +108,9 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *h) const
case Rewardable::SELECT_RANDOM: // give random
grantRewardWithMessage(*RandomGeneratorUtil::nextItem(rewards, cb->gameState()->getRandomGenerator()), true);
break;
case Rewardable::SELECT_ALL: // give all rewards
for(auto i : rewards)
grantRewardWithMessage(i, i == rewards.size() - 1);
}
break;
}