1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Fix leveling up secondary skills via Scholar (map object) visit

This commit is contained in:
Ivan Savenko
2024-06-26 12:38:23 +00:00
parent 5bc103f50e
commit 77e827c51e
2 changed files with 13 additions and 7 deletions

View File

@@ -106,12 +106,12 @@ void Rewardable::Interface::grantRewardBeforeLevelup(IGameCallback * cb, const R
for(const auto & entry : info.reward.secondary)
{
int current = hero->getSecSkillLevel(entry.first);
if( (current != 0 && current < entry.second) ||
(hero->canLearnSkill() ))
{
cb->changeSecSkill(hero, entry.first, entry.second);
}
auto currentLevel = static_cast<MasteryLevel::Type>(hero->getSecSkillLevel(entry.first));
if(currentLevel == MasteryLevel::EXPERT)
continue;
if(currentLevel != MasteryLevel::NONE || hero->canLearnSkill())
cb->changeSecSkill(hero, entry.first, entry.second, false);
}
for(int i=0; i< info.reward.primary.size(); i++)