diff options
author | Warpten <vertozor@gmail.com> | 2013-03-10 23:05:54 +0100 |
---|---|---|
committer | Warpten <vertozor@gmail.com> | 2013-03-10 23:05:54 +0100 |
commit | 11764233c56ed612a043ff2240c6d8fa738d01f3 (patch) | |
tree | dea2226f32a7bb44a3579c64eebaaca51c385b46 /src | |
parent | 866d82a2ce7b5d19bac124c60076e3b1e65dc552 (diff) |
Core/Spells: Fixed removing glyphs.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 6004888fdda..b62dc1c62ab 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -4197,13 +4197,13 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) } // apply new one - if (uint32 glyph = m_spellInfo->Effects[effIndex].MiscValue) + if (uint32 newGlyph = m_spellInfo->Effects[effIndex].MiscValue) { - if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph)) + if (GlyphPropertiesEntry const* newGlyphProperties = sGlyphPropertiesStore.LookupEntry(newGlyph)) { - if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex))) + if (GlyphSlotEntry const* newGlyphSlot = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex))) { - if (gp->TypeFlags != gs->TypeFlags) + if (newGlyphProperties->TypeFlags != newGlyphSlot->TypeFlags) { SendCastResult(SPELL_FAILED_INVALID_GLYPH); return; // glyph slot mismatch @@ -4211,17 +4211,26 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) } // remove old glyph - if (uint32 oldglyph = player->GetGlyph(player->GetActiveSpec(), m_glyphIndex)) + if (uint32 oldGlyph = player->GetGlyph(player->GetActiveSpec(), m_glyphIndex)) { - if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) + if (GlyphPropertiesEntry const* oldGlyphProperties = sGlyphPropertiesStore.LookupEntry(oldGlyph)) { - player->RemoveAurasDueToSpell(old_gp->SpellId); + player->RemoveAurasDueToSpell(oldGlyphProperties->SpellId); player->SetGlyph(m_glyphIndex, 0); } } - player->CastSpell(m_caster, gp->SpellId, true); - player->SetGlyph(m_glyphIndex, glyph); + player->CastSpell(m_caster, newGlyphProperties->SpellId, true); + player->SetGlyph(m_glyphIndex, newGlyph); + player->SendTalentsInfoData(false); + } + } + else if (uint32 oldGlyph = player->GetGlyph(player->GetActiveSpec(), m_glyphIndex)) // Removing the glyph, get the old one + { + if (GlyphPropertiesEntry const* oldGlyphProperties = sGlyphPropertiesStore.LookupEntry(oldGlyph)) + { + player->RemoveAurasDueToSpell(oldGlyphProperties->SpellId); + player->SetGlyph(m_glyphIndex, 0); player->SendTalentsInfoData(false); } } |