diff --git a/src/player.cpp b/src/player.cpp index 9fbebdd964..1cd2f639e3 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -506,8 +506,8 @@ void Player::removeSkillTries(skills_t skill, uint64_t count, bool notify/* = fa while (count > skills[skill].tries) { count -= skills[skill].tries; - if (skills[skill].level <= 10) { - skills[skill].level = 10; + if (skills[skill].level <= MINIMUM_SKILL_LEVEL) { + skills[skill].level = MINIMUM_SKILL_LEVEL; skills[skill].tries = 0; count = 0; break; @@ -2030,7 +2030,7 @@ void Player::death(Creature* lastHitCreature) //Skill loss for (uint8_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) { //for each skill uint64_t sumSkillTries = 0; - for (uint16_t c = 11; c <= skills[i].level; ++c) { //sum up all required tries for all skill levels + for (uint16_t c = MINIMUM_SKILL_LEVEL + 1; c <= skills[i].level; ++c) { //sum up all required tries for all skill levels sumSkillTries += vocation->getReqSkillTries(i, c); } diff --git a/src/player.h b/src/player.h index 3b60a92cac..8ec21b521d 100644 --- a/src/player.h +++ b/src/player.h @@ -100,9 +100,11 @@ struct OutfitEntry { uint8_t addons; }; +static constexpr int16_t MINIMUM_SKILL_LEVEL = 10; + struct Skill { uint64_t tries = 0; - uint16_t level = 10; + uint16_t level = MINIMUM_SKILL_LEVEL; uint8_t percent = 0; };