Core/Players: Fixed spell overrides not being removed when unlearning talents

Port From (https://github.com/TrinityCore/TrinityCore/commit/ad0cb188c91501887f4117157dcb450429652b7c)
This commit is contained in:
hondacrx
2023-07-01 09:27:05 -04:00
parent 445733704e
commit 074127fc34
@@ -2199,6 +2199,7 @@ namespace Game.Entities
bool cur_active = pSpell.Active;
bool cur_dependent = pSpell.Dependent;
int? traitDefinitionId = pSpell.TraitDefinitionId;
if (disabled)
{
@@ -2315,6 +2316,13 @@ namespace Game.Entities
}
}
if (traitDefinitionId.HasValue)
{
var traitDefinition = CliDB.TraitDefinitionStorage.LookupByKey(traitDefinitionId.Value);
if (traitDefinition != null)
RemoveOverrideSpell(traitDefinition.OverridesSpellID, spellId);
}
m_overrideSpells.Remove(spellId);
if (m_canTitanGrip)