diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f4a57e656..d8f33c6fe 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2928,8 +2928,11 @@ bool Player::addTalent(uint32 spellId, uint8 addSpecMask, uint8 oldTalentRank) newTalent->specMask = addSpecMask; newTalent->talentID = talentInfo->TalentID; newTalent->inSpellBook = talentInfo->addToSpellBook && !spellInfo->HasAttribute(SPELL_ATTR0_PASSIVE) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL); - m_talents[spellId] = newTalent; + + if (GetActiveSpecMask() & addSpecMask) + m_usedTalentCount += (talentPos->rank + 1) - oldTalentRank; + return true; } // xinef: if current mask does not cover addMask, add it to iterator and save changes to DB @@ -2939,6 +2942,9 @@ bool Player::addTalent(uint32 spellId, uint8 addSpecMask, uint8 oldTalentRank) if (itr->second->State != PLAYERSPELL_NEW) itr->second->State = PLAYERSPELL_CHANGED; + if (GetActiveSpecMask() & addSpecMask) + m_usedTalentCount += (talentPos->rank + 1) - oldTalentRank; + return true; } @@ -14067,9 +14073,6 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank, bool command /*= fa addTalent(spellId, GetActiveSpecMask(), currentTalentRank); - // xinef: update free talent points count - m_usedTalentCount += talentPointsChange; - if (!command) { SetFreeTalentPoints(CurTalentPoints - talentPointsChange); @@ -15021,9 +15024,6 @@ void Player::_LoadTalents(PreparedQueryResult result) TalentSpellPos const* talentPos = GetTalentSpellPos(spellId); ASSERT(talentPos); - // xinef: increase used talent points count - if (GetActiveSpecMask() & specMask) - m_usedTalentCount += talentPos->rank + 1; } while (result->NextRow()); } }