diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-07-04 13:48:58 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-07-04 13:48:58 +0200 |
commit | 4b29ecd749046d204fd1522b364c2ac3a9be8b64 (patch) | |
tree | 88256fbee09346e08b8869163a00cf1fa6b134a8 /src | |
parent | 430012f4b5e559b2875b0a89474706b22fc17e8f (diff) |
Core/Players: Fixed fury warriors failing to be saved to db on first save after login/respec
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 8 |
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)) |