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

Update lib/mapObjects/CGHeroInstance.cpp

Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
This commit is contained in:
George King
2025-03-22 18:25:30 +01:00
committed by GitHub
parent cae84e0e77
commit 474e044caf

View File

@@ -135,12 +135,8 @@ void CGHeroInstance::setSecSkillLevel(const SecondarySkill & which, int val, boo
{
if (val == 0) // skill removal
{
auto it = std::find_if(secSkills.begin(), secSkills.end(), [&](const std::pair<SecondarySkill, ui8>& pair) { return pair.first == which; });
if (it != secSkills.end())
{
secSkills.erase(it);
updateSkillBonus(which, val);
}
vstd::erase_if(secSkills, [which](const std::pair<SecondarySkill, ui8>& pair) { return pair.first == which; });
updateSkillBonus(which, val);
}
else if(getSecSkillLevel(which) == 0)
{