fix(Core/Spells): Glyphs should send SMSG_LEARNED_SPELL/SMSG_REMOVED_… (#7161)

* fix(Core/Spells): Glyphs should send SMSG_LEARNED_SPELL/SMSG_REMOVED_SPELL packet in case of updating spell tooltips.

Fixed #6323

* chore(Core/CharacterHandler): improve comment

* chore(Core/SpellEffects): improve comment

Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
UltraNix
2021-08-05 15:58:50 +02:00
committed by GitHub
parent ed4cfd37f4
commit ffdd990aa4
3 changed files with 21 additions and 1 deletions

View File

@@ -102,7 +102,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS] =
&Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
&Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP
&Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related
&Spell::EffectUnused, // 46 SPELL_EFFECT_SPAWN clientside, unit appears as if it was just spawned
&Spell::EffectUnused, // 46 SPELL_EFFECT_SPAWN client-side, unit appears as if it was just spawned
&Spell::EffectTradeSkill, // 47 SPELL_EFFECT_TRADE_SKILL
&Spell::EffectUnused, // 48 SPELL_EFFECT_STEALTH one spell: Base Stealth
&Spell::EffectUnused, // 49 SPELL_EFFECT_DETECT one spell: Detect
@@ -4540,8 +4540,12 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex)
// remove old glyph aura
if (uint32 oldGlyph = player->GetGlyph(m_glyphIndex))
if (GlyphPropertiesEntry const* oldGlyphEntry = sGlyphPropertiesStore.LookupEntry(oldGlyph))
{
player->RemoveAurasDueToSpell(oldGlyphEntry->SpellId);
player->SendLearnPacket(oldGlyphEntry->SpellId, false); // Send packet to properly handle client-side spell tooltips
}
player->SendLearnPacket(glyphEntry->SpellId, true); // Send packet to properly handle client-side spell tooltips
player->CastSpell(m_caster, glyphEntry->SpellId, TriggerCastFlags(TRIGGERED_FULL_MASK & ~(TRIGGERED_IGNORE_SHAPESHIFT | TRIGGERED_IGNORE_CASTER_AURASTATE)));
player->SetGlyph(m_glyphIndex, glyph, !player->GetSession()->PlayerLoading());
player->SendTalentsInfoData(false);