Core/Players: Fixed spells being unintentionally removed by talent swaps when they are learned from more than one spell (affects balance druid Celesial Alignment and Incarnation)
Port From (https://github.com/TrinityCore/TrinityCore/commit/2c6ddcce3d6374a82214bb0ddb9d7432351982c9)
This commit is contained in:
@@ -2331,6 +2331,18 @@ namespace Game.Entities
|
||||
|
||||
foreach (var spellNode in spell_bounds)
|
||||
{
|
||||
bool hasOtherSpellTeachingThis = Global.SpellMgr.GetSpellLearnedBySpellMapBounds(spellNode.Spell).Any(learnNode =>
|
||||
{
|
||||
if (learnNode.SourceSpell == spellId)
|
||||
return false;
|
||||
if (!learnNode.Active)
|
||||
return false;
|
||||
return HasSpell(learnNode.SourceSpell);
|
||||
});
|
||||
|
||||
if (hasOtherSpellTeachingThis)
|
||||
continue;
|
||||
|
||||
RemoveSpell(spellNode.Spell, disabled);
|
||||
if (spellNode.OverridesSpell != 0)
|
||||
RemoveOverrideSpell(spellNode.OverridesSpell, spellNode.Spell);
|
||||
|
||||
Reference in New Issue
Block a user