diff options
author | Ovahlord <dreadkiller@gmx.de> | 2024-07-27 11:19:46 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-07-27 11:19:46 +0200 |
commit | cc13f51f1afc723ae9315b7b896c6e41f02e7afb (patch) | |
tree | 5803b7df598669de4b45f7a43c3c3fa09416f574 | |
parent | 7522b55486e7e8f5aa587bd27906536767561a95 (diff) |
Core/Player: fixed updating the number of available talent points after switching specializations and fixed a missing removal of talents when switching specs, resulting in talents from other specs dangling around
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a363f4aa670..8709d10761b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -28369,13 +28369,13 @@ void Player::SetActiveTalentGroup(uint8 group, bool withUpdate /*= true*/) uint32 oldTalentTabId = _talentGroups[_activeTalentGroup].PrimaryTalentTabID; uint32 newTalentTabId = _talentGroups[group].PrimaryTalentTabID; - // Unlearn previously known talent tree related spells if the new talent tab Id is different - if (oldTalentTabId != newTalentTabId) - UnlearnTalentTreePrimarySpells(); - { // Perform cleanup actions on switching talent groups + // Unlearn previously known talent tree related spells if the new talent tab Id is different + if (oldTalentTabId != newTalentTabId) + UnlearnTalentTreePrimarySpells(); + if (IsNonMeleeSpellCast(false)) InterruptNonMeleeSpells(false); @@ -28418,6 +28418,21 @@ void Player::SetActiveTalentGroup(uint8 group, bool withUpdate /*= true*/) SendActionButtons(2); // m_actionButtons.clear() is called in the next _LoadActionButtons + for (auto const& talentPair : _talentGroups[_activeTalentGroup].Talents) + { + TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentPair.first); + if (!talentInfo) + continue; + + for (uint32 spellId : talentInfo->SpellRank) + { + if (!spellId) + continue; + + RemoveSpell(spellId, false, false); + } + } + for (uint32 glyphId : GetGlyphs(GetActiveTalentGroup())) RemoveAurasDueToSpell(sGlyphPropertiesStore.AssertEntry(glyphId)->SpellID); } @@ -28451,6 +28466,8 @@ void Player::SetActiveTalentGroup(uint8 group, bool withUpdate /*= true*/) aurEff->HandleShapeshiftBoosts(this, false); aurEff->HandleShapeshiftBoosts(this, true); } + + UpdateAvailableTalentPoints(); } if (withUpdate) |