Core/Players: Fixed fury warriors failing to be saved to db on first save after login/respec

This commit is contained in:
Shauren
2023-07-04 13:48:58 +02:00
parent 430012f4b5
commit 4b29ecd749
+6 -2
View File
@@ -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))