mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Editing hero primary skill in map editor should not be influenced by artifacts
This commit is contained in:
parent
543ce94132
commit
31e4937a8c
@ -1923,7 +1923,8 @@ int CGHeroInstance::getBasePrimarySkillValue(PrimarySkill which) const
|
||||
{
|
||||
std::string cachingStr = "type_PRIMARY_SKILL_base_" + std::to_string(static_cast<int>(which));
|
||||
auto selector = Selector::typeSubtype(BonusType::PRIMARY_SKILL, BonusSubtypeID(which)).And(Selector::sourceType()(BonusSource::HERO_BASE_SKILL));
|
||||
return valOfBonuses(selector, cachingStr);
|
||||
auto minSkillValue = VLC->engineSettings()->getVector(EGameSettings::HEROES_MINIMAL_PRIMARY_SKILLS)[which.getNum()];
|
||||
return std::max(valOfBonuses(selector, cachingStr), minSkillValue);
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
@ -67,10 +67,10 @@ void HeroSkillsWidget::on_checkBox_toggled(bool checked)
|
||||
|
||||
void HeroSkillsWidget::obtainData()
|
||||
{
|
||||
ui->attack->setValue(hero.getPrimSkillLevel(PrimarySkill::ATTACK));
|
||||
ui->defence->setValue(hero.getPrimSkillLevel(PrimarySkill::DEFENSE));
|
||||
ui->power->setValue(hero.getPrimSkillLevel(PrimarySkill::SPELL_POWER));
|
||||
ui->knowledge->setValue(hero.getPrimSkillLevel(PrimarySkill::KNOWLEDGE));
|
||||
ui->attack->setValue(hero.getBasePrimarySkillValue(PrimarySkill::ATTACK));
|
||||
ui->defence->setValue(hero.getBasePrimarySkillValue(PrimarySkill::DEFENSE));
|
||||
ui->power->setValue(hero.getBasePrimarySkillValue(PrimarySkill::SPELL_POWER));
|
||||
ui->knowledge->setValue(hero.getBasePrimarySkillValue(PrimarySkill::KNOWLEDGE));
|
||||
|
||||
if(!hero.secSkills.empty() && hero.secSkills.front().first.getNum() == -1)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user