diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index fc36f655f..1e43f7a0a 100644 --- a/client/windows/CCreatureWindow.cpp +++ b/client/windows/CCreatureWindow.cpp @@ -96,14 +96,14 @@ private: }; -CCommanderSkillIcon::CCommanderSkillIcon(std::shared_ptr object_, bool isGrandmasterAbility_, std::function callback) +CCommanderSkillIcon::CCommanderSkillIcon(std::shared_ptr object_, bool isMasterAbility_, std::function callback) : object(), - isGrandmasterAbility(isGrandmasterAbility_), - isSelected(false), - callback(callback) + isMasterAbility(isMasterAbility_), + isSelected(false), + callback(callback) { pos = object_->pos; - this->isGrandmasterAbility = isGrandmasterAbility_; + this->isMasterAbility = isMasterAbility_; setObject(object_); } @@ -128,16 +128,16 @@ void CCommanderSkillIcon::deselect() isSelected = false; } -bool CCommanderSkillIcon::getIsGrandmasterAbility() +bool CCommanderSkillIcon::getIsMasterAbility() { - return isGrandmasterAbility; + return isMasterAbility; } void CCommanderSkillIcon::show(Canvas &to) { CIntObject::show(to); - if(isGrandmasterAbility && isSelected) + if(isMasterAbility && isSelected) to.drawBorder(pos, Colors::YELLOW, 2); } @@ -921,7 +921,7 @@ void CStackWindow::setSelection(si32 newSkill, std::shared_ptrgetIsGrandmasterAbility()) //unlike WoG, in VCMI grandmaster skill descriptions are taken from bonus descriptions + if(!selectedIcon->getIsMasterAbility()) //unlike WoG, in VCMI master skill descriptions are taken from bonus descriptions { selectedIcon->text = getSkillDescription(oldSelection, false); //update previously selected icon's message to existing skill level } @@ -932,7 +932,7 @@ void CStackWindow::setSelection(si32 newSkill, std::shared_ptrsetObject(std::make_shared(getSkillImage(newSkill))); - if(!newIcon->getIsGrandmasterAbility()) + if(!newIcon->getIsMasterAbility()) { newIcon->text = getSkillDescription(newSkill, true); //update currently selected icon's message to show upgrade description } diff --git a/client/windows/CCreatureWindow.h b/client/windows/CCreatureWindow.h index 546bce3d6..4b904cb22 100644 --- a/client/windows/CCreatureWindow.h +++ b/client/windows/CCreatureWindow.h @@ -32,10 +32,10 @@ class CCommanderArtPlace; class CCommanderSkillIcon : public LRClickableAreaWText //TODO: maybe bring commander skill button initialization logic inside? { std::shared_ptr object; // passive object that will be used to determine clickable area - bool isGrandmasterAbility; // refers to WoG abilities obtainable via combining grandmaster skills (for example attack + speed unlocks shoot) - bool isSelected; // used only for programatically created border around selected "grandmaster abilities" + bool isMasterAbility; // refers to WoG abilities obtainable via combining master skills (for example attack + speed unlocks shoot) + bool isSelected; // used only for programatically created border around selected "master abilities" public: - CCommanderSkillIcon(std::shared_ptr object_, bool isGrandmasterAbility, std::function callback); + CCommanderSkillIcon(std::shared_ptr object_, bool isMasterAbility_, std::function callback); std::function callback; @@ -43,7 +43,7 @@ public: void setObject(std::shared_ptr object); void deselect(); //TODO: consider using observer pattern instead? - bool getIsGrandmasterAbility(); + bool getIsMasterAbility(); void show(Canvas &to) override; }; diff --git a/lib/CCreatureSet.h b/lib/CCreatureSet.h index 4ef0e7ea7..fefd14869 100644 --- a/lib/CCreatureSet.h +++ b/lib/CCreatureSet.h @@ -139,7 +139,7 @@ public: ui8 level; //required only to count callbacks std::string name; // each Commander has different name std::vector secondarySkills; //ID -> level - std::set specialSKills; + std::set specialSkills; //std::vector arts; void init() override; CCommanderInstance(); @@ -161,7 +161,7 @@ public: h & level; h & name; h & secondarySkills; - h & specialSKills; + h & specialSkills; } }; diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index 97187c890..855c5bbd1 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -803,7 +803,7 @@ void SetCommanderProperty::applyGs(CGameState *gs) break; case SPECIAL_SKILL: commander->accumulateBonus (std::make_shared(accumulatedBonus)); - commander->specialSKills.insert (additionalInfo); + commander->specialSkills.insert (additionalInfo); break; case SECONDARY_SKILL: commander->secondarySkills[additionalInfo] = static_cast(amount); diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 813356a9f..f9650493d 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -468,9 +468,9 @@ void CGameHandler::levelUpCommander(const CCommanderInstance * c) int i = 100; for (auto specialSkill : VLC->creh->skillRequirements) { - if (c->secondarySkills.at(specialSkill.second.first) == ECommander::MAX_SKILL_LEVEL - && c->secondarySkills.at(specialSkill.second.second) == ECommander::MAX_SKILL_LEVEL - && !vstd::contains (c->specialSKills, i)) + if (c->secondarySkills.at(specialSkill.second.first) >= ECommander::MAX_SKILL_LEVEL - 1 + && c->secondarySkills.at(specialSkill.second.second) >= ECommander::MAX_SKILL_LEVEL - 1 + && !vstd::contains (c->specialSkills, i)) clu.skills.push_back (i); ++i; }