aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2010-03-23 14:38:31 -0500
committern0n4m3 <none@none>2010-03-23 14:38:31 -0500
commit5fe2454b246b50cb8be7cda2e6941567f1d9fc45 (patch)
treea9c06db37d59ffe8632daf2efb07333870b57a48 /src/game/SpellEffects.cpp
parent1e9de7dbd776316a138d965dba84696e5ec354e0 (diff)
Fix one WPE exploit.
When apply more 6 gems, and after player logout, server crash, also apply code style and cleanup. --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 5cad98538e7..a5640ad4106 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -6337,19 +6337,19 @@ void Spell::EffectActivateObject(uint32 effect_idx)
void Spell::EffectApplyGlyph(uint32 i)
{
- if(m_caster->GetTypeId() != TYPEID_PLAYER)
+ if (m_caster->GetTypeId() != TYPEID_PLAYER || m_glyphIndex >= MAX_GLYPH_SLOT_INDEX)
return;
Player *player = (Player*)m_caster;
// apply new one
- if(uint32 glyph = m_spellInfo->EffectMiscValue[i])
+ if (uint32 glyph = m_spellInfo->EffectMiscValue[i])
{
- if(GlyphPropertiesEntry const *gp = sGlyphPropertiesStore.LookupEntry(glyph))
+ if (GlyphPropertiesEntry const *gp = sGlyphPropertiesStore.LookupEntry(glyph))
{
- if(GlyphSlotEntry const *gs = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex)))
+ if (GlyphSlotEntry const *gs = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex)))
{
- if(gp->TypeFlags != gs->TypeFlags)
+ if (gp->TypeFlags != gs->TypeFlags)
{
SendCastResult(SPELL_FAILED_INVALID_GLYPH);
return; // glyph slot mismatch
@@ -6357,9 +6357,9 @@ void Spell::EffectApplyGlyph(uint32 i)
}
// remove old glyph
- if(uint32 oldglyph = player->GetGlyph(m_glyphIndex))
+ if (uint32 oldglyph = player->GetGlyph(m_glyphIndex))
{
- if(GlyphPropertiesEntry const *old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph))
+ if (GlyphPropertiesEntry const *old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph))
{
player->RemoveAurasDueToSpell(old_gp->SpellId);
player->SetGlyph(m_glyphIndex, 0);