1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Do not give spells as reward if hero can't learn them

This commit is contained in:
Ivan Savenko
2024-04-12 00:25:02 +03:00
parent 53fcd3ad26
commit 9e81c53547
2 changed files with 10 additions and 3 deletions

View File

@@ -102,7 +102,8 @@ void Rewardable::Reward::loadComponents(std::vector<Component> & comps, const CG
comps.emplace_back(ComponentType::ARTIFACT, entry);
for(const auto & entry : spells)
comps.emplace_back(ComponentType::SPELL, entry);
if (!h || h->canLearnSpell(entry.toEntity(VLC), true))
comps.emplace_back(ComponentType::SPELL, entry);
for(const auto & entry : creatures)
comps.emplace_back(ComponentType::CREATURE, entry.type->getId(), entry.count);