From 6263c4c3eb999b1e52ea04b46621e204e33060db Mon Sep 17 00:00:00 2001 From: Henning Koehler Date: Mon, 5 Mar 2018 20:02:23 +1300 Subject: [PATCH] renamed CGHeroInstance::updateSkill to updateSkillBonus --- lib/mapObjects/CGHeroInstance.cpp | 9 +++++---- lib/mapObjects/CGHeroInstance.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/mapObjects/CGHeroInstance.cpp b/lib/mapObjects/CGHeroInstance.cpp index 9bd6bea8b..fac58f029 100644 --- a/lib/mapObjects/CGHeroInstance.cpp +++ b/lib/mapObjects/CGHeroInstance.cpp @@ -157,7 +157,7 @@ void CGHeroInstance::setSecSkillLevel(SecondarySkill which, int val, bool abs) if(getSecSkillLevel(which) == 0) { secSkills.push_back(std::pair(which, val)); - updateSkill(which, val); + updateSkillBonus(which, val); } else { @@ -175,7 +175,7 @@ void CGHeroInstance::setSecSkillLevel(SecondarySkill which, int val, bool abs) logGlobal->warn("Skill %d increased over limit! Decreasing to Expert.", static_cast(which.toEnum())); elem.second = 3; } - updateSkill(which, elem.second); //when we know final value + updateSkillBonus(which, elem.second); //when we know final value } } } @@ -537,7 +537,7 @@ void CGHeroInstance::recreateSecondarySkillsBonuses() for(auto skill_info : secSkills) if(skill_info.second > 0) - updateSkill(SecondarySkill(skill_info.first), skill_info.second); + updateSkillBonus(SecondarySkill(skill_info.first), skill_info.second); } void CGHeroInstance::recreateSpecialtyBonuses(std::vector & specialtyDeprecated) @@ -557,13 +557,14 @@ void CGHeroInstance::recreateSpecialtyBonuses(std::vector & speci } } -void CGHeroInstance::updateSkill(SecondarySkill which, int val) +void CGHeroInstance::updateSkillBonus(SecondarySkill which, int val) { removeBonuses(Selector::source(Bonus::SECONDARY_SKILL, which)); auto skillBonus = (*VLC->skillh)[which]->getBonus(val); for (auto b : skillBonus) addNewBonus(std::make_shared(*b)); } + void CGHeroInstance::setPropertyDer( ui8 what, ui32 val ) { if(what == ObjProperty::PRIMARY_STACK_COUNT) diff --git a/lib/mapObjects/CGHeroInstance.h b/lib/mapObjects/CGHeroInstance.h index 1ac720be6..3185e36de 100644 --- a/lib/mapObjects/CGHeroInstance.h +++ b/lib/mapObjects/CGHeroInstance.h @@ -215,7 +215,7 @@ public: ui8 maxlevelsToMagicSchool() const; ui8 maxlevelsToWisdom() const; void recreateSecondarySkillsBonuses(); - void updateSkill(SecondarySkill which, int val); + void updateSkillBonus(SecondarySkill which, int val); bool hasVisions(const CGObjectInstance * target, const int subtype) const; /// If this hero perishes, the scenario is failed