1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix incorrect icon on removal of skill

This commit is contained in:
Ivan Savenko
2025-05-16 17:43:27 +03:00
parent cb82c6a4f6
commit c7228b7e50
2 changed files with 2 additions and 1 deletions

View File

@@ -107,7 +107,7 @@ void Rewardable::Reward::loadComponents(std::vector<Component> & comps, const CG
auto skillID = entry.first;
int levelsGained = entry.second;
int currentLevel = h ? h->getSecSkillLevel(skillID) : 0;
int finalLevel = std::min(static_cast<int>(MasteryLevel::EXPERT), currentLevel + levelsGained);
int finalLevel = std::clamp<int>(currentLevel + levelsGained, MasteryLevel::BASIC, MasteryLevel::EXPERT);
comps.emplace_back(ComponentType::SEC_SKILL, entry.first, finalLevel);
}