diff options
author | Ovahlord <dreadkiller@gmx.de> | 2024-07-28 01:32:42 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-07-28 01:32:42 +0200 |
commit | d8a9f7bd255f84db46edd5108ef62b1024119869 (patch) | |
tree | 1be771447304edf70c9156e2fcbb05d0d5344a83 /src/server/game/Spells/SpellEffects.cpp | |
parent | 5657225f731086023d096152d5bf1c123b9560d9 (diff) |
Core/Players: updated glyph handling for Cataclysm
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c91b83e5156..b959ec5858c 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3331,41 +3331,15 @@ void Spell::EffectApplyGlyph() if (!player) return; - std::vector<uint32>& glyphs = player->GetGlyphs(player->GetActiveTalentGroup()); - std::size_t replacedGlyph = glyphs.size(); - for (std::size_t i = 0; i < glyphs.size(); ++i) - { - if (std::vector<uint32> const* activeGlyphBindableSpells = sDB2Manager.GetGlyphBindableSpells(glyphs[i])) - { - if (std::find(activeGlyphBindableSpells->begin(), activeGlyphBindableSpells->end(), m_misc.SpellId) != activeGlyphBindableSpells->end()) - { - replacedGlyph = i; - player->RemoveAurasDueToSpell(sGlyphPropertiesStore.AssertEntry(glyphs[i])->SpellID); - break; - } - } - } + if (m_misc.GlyphSlot >= player->m_activePlayerData->Glyphs.size()) + return; uint32 glyphId = effectInfo->MiscValue; - if (replacedGlyph < glyphs.size()) - { - if (glyphId) - glyphs[replacedGlyph] = glyphId; - else - glyphs.erase(glyphs.begin() + replacedGlyph); - } - else if (glyphId) - glyphs.push_back(glyphId); - player->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::ChangeGlyph); - - if (GlyphPropertiesEntry const* glyphProperties = sGlyphPropertiesStore.LookupEntry(glyphId)) - player->CastSpell(player, glyphProperties->SpellID, this); - - WorldPackets::Talent::ActiveGlyphs activeGlyphs; - activeGlyphs.Glyphs.emplace_back(m_misc.SpellId, uint16(glyphId)); - activeGlyphs.IsFullUpdate = false; - player->SendDirectMessage(activeGlyphs.Write()); + if (glyphId) + player->ApplyGlyph(m_misc.GlyphSlot, glyphId); + else + player->RemoveGlyph(m_misc.GlyphSlot); } void Spell::EffectEnchantHeldItem() |