fix(Core/Spells): Fixed displaying "That Glyph is already inscribed in your spellbook" when activating the same glyph in different spec. (#7162)

Fixed #6342

Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
UltraNix
2021-08-05 20:06:10 +02:00
committed by GitHub
parent d2e84eabb8
commit 279b6de88c

View File

@@ -14137,11 +14137,22 @@ void Player::ActivateSpec(uint8 spec)
}
// xinef: apply glyphs from second spec
if(GetActiveSpec() != oldSpec)
if (GetActiveSpec() != oldSpec)
{
for (uint8 slot = 0; slot < MAX_GLYPH_SLOT_INDEX; ++slot)
if (uint32 glyphId = m_Glyphs[GetActiveSpec()][slot])
{
uint32 glyphId = m_Glyphs[GetActiveSpec()][slot];
if (glyphId)
{
if (GlyphPropertiesEntry const* glyphEntry = sGlyphPropertiesStore.LookupEntry(glyphId))
{
CastSpell(this, glyphEntry->SpellId, TriggerCastFlags(TRIGGERED_FULL_MASK & ~(TRIGGERED_IGNORE_SHAPESHIFT | TRIGGERED_IGNORE_CASTER_AURASTATE)));
}
}
SetGlyph(slot, glyphId, true);
}
}
m_usedTalentCount = spentTalents;
InitTalentForLevel();