aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 0569a7eda5e..1a3b5b949ee 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -5824,7 +5824,9 @@ void Player::SetSkill(uint32 id, uint16 step, uint16 newVal, uint16 maxVal)
{
if (currVal == 0) // activated skill, mark as new to save into database
{
- itr->second.uState = SKILL_NEW;
+ itr->second.uState = itr->second.uState != SKILL_DELETED
+ ? SKILL_NEW
+ : SKILL_CHANGED; // skills marked as SKILL_DELETED already exist in database, mark as changed instead of new
// Set profession line
int32 freeProfessionSlot = FindEmptyProfessionSlotFor(id);
@@ -5880,7 +5882,9 @@ void Player::SetSkill(uint32 id, uint16 step, uint16 newVal, uint16 maxVal)
SetSkillPermBonus(itr->second.pos, 0);
// mark as deleted so the next save will delete the data from the database
- itr->second.uState = SKILL_DELETED;
+ itr->second.uState = itr->second.uState != SKILL_NEW
+ ? SKILL_DELETED
+ : SKILL_UNCHANGED; // skills marked as SKILL_NEW don't exist in database (this distinction is not neccessary for deletion but for re-learning the same skill before save to db happens)
// remove all spells that related to this skill
if (std::vector<SkillLineAbilityEntry const*> const* skillLineAbilities = sDB2Manager.GetSkillLineAbilitiesBySkill(id))